/** * INTERNAL: * Return all the target keys associated with the mapping. */ public Vector<DatabaseField> getTargetKeyFields() { return this.mechanism.getTargetKeyFields(); }
/** * INTERNAL: * Return all the target keys associated with the mapping. */ public Vector<DatabaseField> getTargetKeyFields() { return this.mechanism.getTargetKeyFields(); }
/** * INTERNAL: * Return all the target keys associated with the mapping. */ public Vector<DatabaseField> getTargetKeyFields() { return this.mechanism.getTargetKeyFields(); }
/** * INTERNAL: * Checks if a single target key was specified. */ protected boolean isSingleTargetRelationKeySpecified() { return getTargetKeyFields().isEmpty(); }
/** * INTERNAL: * Checks if a single target key was specified. */ protected boolean isSingleTargetRelationKeySpecified() { return getTargetKeyFields().isEmpty(); }
/** * INTERNAL: * Checks if a single target key was specified. */ protected boolean isSingleTargetRelationKeySpecified() { return getTargetKeyFields().isEmpty(); }
/** * INTERNAL: * All the target key field names are converted to DatabaseField and stored. */ protected void initializeTargetKeys(AbstractSession session, ForeignReferenceMapping mapping) { for (int index = 0; index < getTargetKeyFields().size(); index++) { DatabaseField field = mapping.getReferenceDescriptor().buildField(getTargetKeyFields().get(index)); getTargetKeyFields().set(index, field); } }
/** * INTERNAL: * All the target key field names are converted to DatabaseField and stored. */ protected void initializeTargetKeys(AbstractSession session, ForeignReferenceMapping mapping) { for (int index = 0; index < getTargetKeyFields().size(); index++) { DatabaseField field = mapping.getReferenceDescriptor().buildField(getTargetKeyFields().get(index)); getTargetKeyFields().set(index, field); } }
/** * INTERNAL: * All the target key field names are converted to DatabaseField and stored. */ protected void initializeTargetKeys(AbstractSession session, ForeignReferenceMapping mapping) { for (int index = 0; index < getTargetKeyFields().size(); index++) { DatabaseField field = mapping.getReferenceDescriptor().buildField(getTargetKeyFields().get(index)); getTargetKeyFields().set(index, field); } }
/** * PUBLIC: * Return the target key field names associated with the mapping. * These are in-order with the targetRelationKeyFieldNames. */ public Vector getTargetKeyFieldNames() { Vector fieldNames = new Vector(getTargetKeyFields().size()); for (Enumeration fieldsEnum = getTargetKeyFields().elements(); fieldsEnum.hasMoreElements();) { fieldNames.addElement(((DatabaseField)fieldsEnum.nextElement()).getQualifiedName()); } return fieldNames; }
/** * PUBLIC: * Return the target key field names associated with the mapping. * These are in-order with the targetRelationKeyFieldNames. */ public Vector getTargetKeyFieldNames() { Vector fieldNames = new Vector(getTargetKeyFields().size()); for (Enumeration fieldsEnum = getTargetKeyFields().elements(); fieldsEnum.hasMoreElements();) { fieldNames.addElement(((DatabaseField)fieldsEnum.nextElement()).getQualifiedName()); } return fieldNames; }
/** * PUBLIC: * Return the target key field names associated with the mapping. * These are in-order with the targetRelationKeyFieldNames. */ public Vector getTargetKeyFieldNames() { Vector fieldNames = new Vector(getTargetKeyFields().size()); for (Enumeration fieldsEnum = getTargetKeyFields().elements(); fieldsEnum.hasMoreElements();) { fieldNames.addElement(((DatabaseField)fieldsEnum.nextElement()).getQualifiedName()); } return fieldNames; }
/** * PUBLIC: * Add the fields in the intermediate table that corresponds to the primary * key in the target table. This method is used if the keys are composite. */ public void addTargetRelationKeyField(DatabaseField targetRelationKeyField, DatabaseField targetPrimaryKeyField) { getTargetRelationKeyFields().addElement(targetRelationKeyField); getTargetKeyFields().addElement(targetPrimaryKeyField); }
/** * PUBLIC: * Add the fields in the intermediate table that corresponds to the primary * key in the target table. This method is used if the keys are composite. */ public void addTargetRelationKeyField(DatabaseField targetRelationKeyField, DatabaseField targetPrimaryKeyField) { getTargetRelationKeyFields().addElement(targetRelationKeyField); getTargetKeyFields().addElement(targetPrimaryKeyField); }
/** * PUBLIC: * Add the fields in the intermediate table that corresponds to the primary * key in the target table. This method is used if the keys are composite. */ public void addTargetRelationKeyField(DatabaseField targetRelationKeyField, DatabaseField targetPrimaryKeyField) { getTargetRelationKeyFields().addElement(targetRelationKeyField); getTargetKeyFields().addElement(targetPrimaryKeyField); }
/** * INTERNAL: * If a user does not specify the target key then the primary keys of the target table are used. */ protected void initializeTargetKeysWithDefaults(AbstractSession session, ForeignReferenceMapping mapping) { List<DatabaseField> primaryKeyFields = mapping.getReferenceDescriptor().getPrimaryKeyFields(); for (int index = 0; index < primaryKeyFields.size(); index++) { getTargetKeyFields().addElement(primaryKeyFields.get(index)); } }
/** * INTERNAL: * If a user does not specify the target key then the primary keys of the target table are used. */ protected void initializeTargetKeysWithDefaults(AbstractSession session, ForeignReferenceMapping mapping) { List<DatabaseField> primaryKeyFields = mapping.getReferenceDescriptor().getPrimaryKeyFields(); for (int index = 0; index < primaryKeyFields.size(); index++) { getTargetKeyFields().addElement(primaryKeyFields.get(index)); } }
/** * INTERNAL: * If a user does not specify the target key then the primary keys of the target table are used. */ protected void initializeTargetKeysWithDefaults(AbstractSession session, ForeignReferenceMapping mapping) { List<DatabaseField> primaryKeyFields = mapping.getReferenceDescriptor().getPrimaryKeyFields(); for (int index = 0; index < primaryKeyFields.size(); index++) { getTargetKeyFields().addElement(primaryKeyFields.get(index)); } }
/** * INTERNAL: * The mapping clones itself to create deep copy. */ public Object clone() { RelationTableMechanism clone; try { clone = (RelationTableMechanism)super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(); } clone.setTargetKeyFields(cloneFields(getTargetKeyFields())); clone.setSourceKeyFields(cloneFields(getSourceKeyFields())); clone.setTargetRelationKeyFields(cloneFields(getTargetRelationKeyFields())); clone.setSourceRelationKeyFields(cloneFields(getSourceRelationKeyFields())); clone.setInsertQuery((DataModifyQuery) insertQuery.clone()); clone.setDeleteQuery((DataModifyQuery) deleteQuery.clone()); if(lockRelationTableQuery != null) { clone.lockRelationTableQuery = (DirectReadQuery)lockRelationTableQuery.clone(); } return clone; }
/** * Build relation table definitions for all many-to-many relationships in a EclipseLink descriptor. */ private void buildRelationTableDefinition(RelationTableMechanism relationTableMechanism, DatabaseField listOrderField, ContainerPolicy cp) { //first create relation table TableDefinition tblDef = getTableDefFromDBTable(relationTableMechanism.getRelationTable()); //add source foreign key fields into the relation table Vector srcFkFields = relationTableMechanism.getSourceRelationKeyFields(); Vector srcKeyFields = relationTableMechanism.getSourceKeyFields(); buildRelationTableFields(tblDef, srcFkFields, srcKeyFields); //add target foreign key fields into the relation table Vector targFkFields = relationTableMechanism.getTargetRelationKeyFields(); Vector targKeyFields = relationTableMechanism.getTargetKeyFields(); buildRelationTableFields(tblDef, targFkFields, targKeyFields); if (cp != null){ addFieldsForMappedKeyMapContainerPolicy(cp, tblDef); } if(listOrderField != null) { tblDef.addField(getFieldDefFromDBField(listOrderField, false)); } }