Esempio n. 1
0
 public PropertyBuilder addProperty(PropertyType propertyType, String propertyName) {
   if (!propertyNames.add(propertyName)) {
     throw new RuntimeException("Property already defined: " + propertyName);
   }
   PropertyBuilder builder =
       new Property.PropertyBuilder(schema, this, propertyType, propertyName);
   properties.add(builder.getProperty());
   return builder;
 }
Esempio n. 2
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;
 }