/** * PUBLIC: * This protocol can be used to map the primary key fields in a multiple * table descriptor. By default TopLink assumes that all of the primary key * fields are named the same. */ public void addMultipleTablePrimaryKeyField(DatabaseField sourceField, DatabaseField targetField) throws DescriptorException { addMultipleTableForeignKeys(sourceField, targetField, false); }
/** * PUBLIC: * This protocol can be used to associate multiple tables with foreign key * information. The join criteria will be generated based on the fields * provided. By default TopLink associates multiple tables using a primary * key join where the primary keys fields are named the same. */ public void addMultipleTableForeignKeyField(DatabaseField sourceField, DatabaseField targetField) throws DescriptorException { addMultipleTableForeignKeys(sourceField, targetField, true); }
/** * INTERNAL: * This method is used by the TopLink XML Deployment Descriptor to read and write these mappings */ public void setMultipleTablePrimaryKeyFieldNames(Vector associations) throws DescriptorException { Enumeration foreignKeys = associations.elements(); while (foreignKeys.hasMoreElements()) { Association association = (Association)foreignKeys.nextElement(); addMultipleTableForeignKeys((String)association.getKey(), (String)association.getValue(), true); } }
/** * INTERNAL: * This method is used by the TopLink XML Deployment Descriptor to read and write these mappings */ public void setMultipleTableForeignKeyFieldNames(Vector associations) throws DescriptorException { Enumeration foreignKeys = associations.elements(); while (foreignKeys.hasMoreElements()) { Association association = (Association)foreignKeys.nextElement(); addMultipleTableForeignKeys((String)association.getKey(), (String)association.getValue(), true); } }
/** * INTERNAL: * Add the multiple table fields, if is a foreign key then add the tables to the * foreign keys ordering. */ protected void addMultipleTableForeignKeys(String fieldNameInSourceTable, String fieldNameInTargetTable, boolean isForeignKey) throws DescriptorException { addMultipleTableForeignKeys(new DatabaseField(fieldNameInSourceTable), new DatabaseField(fieldNameInTargetTable), isForeignKey); }