示例#1
0
 public ToOne addToOneWithoutProperty(
     String name, Entity target, String fkColumnName, boolean notNull, boolean unique) {
   PropertyBuilder propertyBuilder = new PropertyBuilder(schema, this, null, name);
   if (notNull) {
     propertyBuilder.notNull();
   }
   if (unique) {
     propertyBuilder.unique();
   }
   propertyBuilder.columnName(fkColumnName);
   Property column = propertyBuilder.getProperty();
   Property[] fkColumns = {column};
   ToOne toOne = new ToOne(schema, this, target, fkColumns, false);
   toOne.setName(name);
   toOneRelations.add(toOne);
   return toOne;
 }
示例#2
0
 /** Adds a standard _id column required by standard Android classes, e.g. list adapters. */
 public PropertyBuilder addIdProperty() {
   PropertyBuilder builder = addLongProperty("id");
   builder.columnName("_id").primaryKey();
   return builder;
 }