/** * PUBLIC: * Add the field to the table, default sizes are used. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type) { this.addField(new FieldDefinition(fieldName, type)); }
/** * PUBLIC: * Add the field to the table. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type, int fieldSize, int fieldSubSize) { this.addField(new FieldDefinition(fieldName, type, fieldSize, fieldSubSize)); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type) { this.addField(new FieldDefinition(fieldName, type)); }
/** * PUBLIC: * Add the field to the table. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type, int fieldSize) { this.addField(new FieldDefinition(fieldName, type, fieldSize)); }
/** * PUBLIC: * Add the field to the table. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type, int fieldSize, int fieldSubSize) { this.addField(new FieldDefinition(fieldName, type, fieldSize, fieldSubSize)); }
/** * PUBLIC: * Add the field to the type to a nested type. * @param typeName is the name of the nested type. */ public void addField(String fieldName, String typeName) { addField(new FieldDefinition(fieldName, typeName)); }
/** * PUBLIC: * Add the field to the table. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type, int fieldSize) { this.addField(new FieldDefinition(fieldName, type, fieldSize)); }
/** * PUBLIC: * Add the field to the table. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type, int fieldSize, int fieldSubSize) { this.addField(new FieldDefinition(fieldName, type, fieldSize, fieldSubSize)); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * @param type is the Java class type corresponding to the database type. */ public void addField(String fieldName, Class type) { this.addField(new FieldDefinition(fieldName, type)); }
/** * PUBLIC: * Add the field to the type to a nested type. * @param typeName is the name of the nested type. */ public void addField(String fieldName, String typeName) { addField(new FieldDefinition(fieldName, typeName)); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * This field is set as part of the primary key. * @param type is the Java class type corresponding to the database type. */ public void addPrimaryKeyField(String fieldName, Class type) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * This field is set as part of the primary key. * @param type is the Java class type corresponding to the database type. */ public void addPrimaryKeyField(String fieldName, Class type) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * This field is set as part of the primary key. * @param type is the Java class type corresponding to the database type. */ public void addPrimaryKeyField(String fieldName, Class type, int fieldSize) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type, fieldSize); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * This field is set as part of the primary key. * @param type is the Java class type corresponding to the database type. */ public void addPrimaryKeyField(String fieldName, Class type) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * This field is set as part of the primary key. * @param type is the Java class type corresponding to the database type. */ public void addPrimaryKeyField(String fieldName, Class type, int fieldSize) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type, fieldSize); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * Build and add a field definition object to relation table */ protected void setFieldToRelationTable(DatabaseField dbField, TableDefinition table) { FieldDefinition fieldDef = getFieldDefFromDBField(dbField); if (!table.getFields().contains(fieldDef)) { //only add the field once, to avoid add twice if m:m is bi-directional. table.addField(getFieldDefFromDBField(dbField)); fieldDef.setIsPrimaryKey(true); // make this a PK as we will be creating constrains later } }
/** * Build and add a field definition object to relation table */ private void setFieldToRelationTable(DatabaseField dbField, TableDefinition tblDef) { FieldDefinition fieldDef = getFieldDefFromDBField(dbField, false); if (!tblDef.getFields().contains(fieldDef)) { //only add the field once, to avoid add twice if m:m is bi-directional. tblDef.addField(getFieldDefFromDBField(dbField, false)); fieldDef.setIsPrimaryKey(true); // make this a PK as we will be creating constrains later } }
/** * Build and add a field definition object to relation table */ protected void setFieldToRelationTable(DatabaseField dbField, TableDefinition table) { FieldDefinition fieldDef = getFieldDefFromDBField(dbField); if (!table.getFields().contains(fieldDef)) { //only add the field once, to avoid add twice if m:m is bi-directional. table.addField(getFieldDefFromDBField(dbField)); fieldDef.setIsPrimaryKey(true); // make this a PK as we will be creating constrains later } }
/** * INTERNAL: * Return a TableDefinition specifying a unary sequence table. */ public TableDefinition buildTableDefinition() { TableDefinition definition = new TableDefinition(); definition.setName(getName()); definition.addField(getSequenceCounterFieldName(), BigDecimal.class); return definition; }
private void addForeignKeyFieldToSourceTargetTable(OneToManyMapping mapping) { addForeignMappingFkConstraint(mapping.getTargetForeignKeysToSourceKeys()); if(mapping.getListOrderField() != null) { getTableDefFromDBTable(mapping.getListOrderField().getTable()).addField(getFieldDefFromDBField(mapping.getListOrderField(), false)); } }