/** * 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, 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) { 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); }
/** * Build a field definition object from a database field. */ private FieldDefinition getDirectCollectionReferenceKeyFieldDefFromDBField(DatabaseField dbField) { FieldDefinition fieldDef = (FieldDefinition)getFieldDefFromDBField(dbField, true).clone(); //direct collection/map table reference kye filed is not unique, need to set it as non-pk. fieldDef.setIsPrimaryKey(false); return 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 } }
/** * PUBLIC: * Add the field to the table, default sizes are used. * Identity fields are used on Sybase for native sequencing, * The field must be of number type and cannot have a subsize. * @param type is the Java class type corresponding to the database type. */ public void addIdentityField(String fieldName, Class type, int fieldSize) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type, fieldSize); fieldDef.setIsIdentity(true); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * Identity fields are used on Sybase for native sequencing, * The field must be of number type and cannot have a subsize. * @param type is the Java class type corresponding to the database type. */ public void addIdentityField(String fieldName, Class type) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type); fieldDef.setIsIdentity(true); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * Identity fields are used on Sybase for native sequencing, * The field must be of number type and cannot have a subsize. * @param type is the Java class type corresponding to the database type. */ public void addIdentityField(String fieldName, Class type, int fieldSize) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type, fieldSize); fieldDef.setIsIdentity(true); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * Identity fields are used on Sybase for native sequencing, * The field must be of number type and cannot have a subsize. * @param type is the Java class type corresponding to the database type. */ public void addIdentityField(String fieldName, Class type) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type); fieldDef.setIsIdentity(true); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * Identity fields are used on Sybase for native sequencing, * The field must be of number type and cannot have a subsize. * @param type is the Java class type corresponding to the database type. */ public void addIdentityField(String fieldName, Class type, int fieldSize) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type, fieldSize); fieldDef.setIsIdentity(true); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
/** * PUBLIC: * Add the field to the table, default sizes are used. * Identity fields are used on Sybase for native sequencing, * The field must be of number type and cannot have a subsize. * @param type is the Java class type corresponding to the database type. */ public void addIdentityField(String fieldName, Class type) { FieldDefinition fieldDef = new FieldDefinition(fieldName, type); fieldDef.setIsIdentity(true); fieldDef.setIsPrimaryKey(true); addField(fieldDef); }
fieldDef.setIsPrimaryKey(isPrimaryKey); fieldMap.put(dbField, fieldDef); databaseFields.put(dbField, dbField);
fieldDef.setIsPrimaryKey(true);