/** * INTERNAL: * Return source key fields for translation by an AggregateObjectMapping */ @Override public Collection getFieldsForTranslationInAggregate() { return getSourceKeyFields(); }
/** * INTERNAL: * Return source key fields for translation by an AggregateObjectMapping */ @Override public Collection getFieldsForTranslationInAggregate() { return getSourceKeyFields(); }
/** * Return whether the source key is specified. * It will be empty when #setTargetForeignKeyFieldName(String) is used. */ protected boolean isSourceKeySpecified() { return !getSourceKeyFields().isEmpty(); }
/** * Return whether the source key is specified. * It will be empty when #setTargetForeignKeyFieldName(String) is used. */ protected boolean isSourceKeySpecified() { return !getSourceKeyFields().isEmpty(); }
/** * INTERNAL: * This method is used to store the FK fields that can be cached that correspond to noncacheable mappings * the FK field values will be used to re-issue the query when cloning the shared cache entity */ @Override public void collectQueryParameters(Set<DatabaseField> cacheFields){ for (DatabaseField field : getSourceKeyFields()) { cacheFields.add(field); } }
/** * Return whether the source key is specified. * It will be empty when #setTargetForeignKeyFieldName(String) is used. */ protected boolean isSourceKeySpecified() { return !getSourceKeyFields().isEmpty(); }
/** * INTERNAL: * This method is used to store the FK fields that can be cached that correspond to noncacheable mappings * the FK field values will be used to re-issue the query when cloning the shared cache entity */ @Override public void collectQueryParameters(Set<DatabaseField> cacheFields){ for (DatabaseField field : getSourceKeyFields()) { cacheFields.add(field); } }
/** * PUBLIC: * Return the source key field names associated with the mapping. * These are in-order with the targetForeignKeyFieldNames. */ public Vector getSourceKeyFieldNames() { Vector fieldNames = new Vector(getSourceKeyFields().size()); for (Enumeration fieldsEnum = getSourceKeyFields().elements(); fieldsEnum.hasMoreElements();) { fieldNames.addElement(((DatabaseField)fieldsEnum.nextElement()).getQualifiedName()); } return fieldNames; }
/** * PUBLIC: * Return the source key field names associated with the mapping. * These are in-order with the targetForeignKeyFieldNames. */ public Vector getSourceKeyFieldNames() { Vector fieldNames = new Vector(getSourceKeyFields().size()); for (Enumeration fieldsEnum = getSourceKeyFields().elements(); fieldsEnum.hasMoreElements();) { fieldNames.addElement(((DatabaseField)fieldsEnum.nextElement()).getQualifiedName()); } return fieldNames; }
/** * PUBLIC: * Return the source key field names associated with the mapping. * These are in-order with the targetForeignKeyFieldNames. */ public Vector getSourceKeyFieldNames() { Vector fieldNames = new Vector(getSourceKeyFields().size()); for (Enumeration fieldsEnum = getSourceKeyFields().elements(); fieldsEnum.hasMoreElements();) { fieldNames.addElement(((DatabaseField)fieldsEnum.nextElement()).getQualifiedName()); } return fieldNames; }
/** * INTERNAL: * Add the associated fields to the appropriate collections. */ public void addTargetForeignKeyField(DatabaseField targetForeignKeyField, DatabaseField sourceKeyField) { getTargetForeignKeyFields().addElement(targetForeignKeyField); getSourceKeyFields().addElement(sourceKeyField); }
/** * INTERNAL: * Add the associated fields to the appropriate collections. */ @Override public void addTargetForeignKeyField(DatabaseField targetForeignKeyField, DatabaseField sourceKeyField) { getTargetForeignKeyFields().addElement(targetForeignKeyField); getSourceKeyFields().addElement(sourceKeyField); }
/** * INTERNAL: * Add the associated fields to the appropriate collections. */ @Override public void addTargetForeignKeyField(DatabaseField targetForeignKeyField, DatabaseField sourceKeyField) { getTargetForeignKeyFields().addElement(targetForeignKeyField); getSourceKeyFields().addElement(sourceKeyField); }
@Override public Object getAttributeValueFromObject(Object object) { List sourceFields = ((OneToManyMapping)object).getSourceKeyFields(); List targetFields = ((OneToManyMapping)object).getTargetForeignKeyFields(); List associations = new ArrayList(sourceFields.size()); for (int index = 0; index < sourceFields.size(); index++) { associations.add(new Association(targetFields.get(index), sourceFields.get(index))); } return associations; }
public Object getAttributeValueFromObject(Object object) { List sourceFields = ((OneToManyMapping)object).getSourceKeyFields(); List targetFields = ((OneToManyMapping)object).getTargetForeignKeyFields(); List associations = new ArrayList(sourceFields.size()); for (int index = 0; index < sourceFields.size(); index++) { associations.add(new Association(targetFields.get(index), sourceFields.get(index))); } return associations; }
public Object getAttributeValueFromObject(Object object) { List sourceFields = ((OneToManyMapping)object).getSourceKeyFields(); List targetFields = ((OneToManyMapping)object).getTargetForeignKeyFields(); List associations = new ArrayList(sourceFields.size()); for (int index = 0; index < sourceFields.size(); index++) { associations.add(new Association(targetFields.get(index), sourceFields.get(index))); } return associations; }
protected void addOneToManyMappingLines(NonreflectiveMethodDefinition method, String mappingName, OneToManyMapping mapping) { Enumeration targetKeysEnum = mapping.getTargetForeignKeyFields().elements(); Enumeration sourceKeysEnum = mapping.getSourceKeyFields().elements(); while (sourceKeysEnum.hasMoreElements()) { DatabaseField sourceField = (DatabaseField)sourceKeysEnum.nextElement(); DatabaseField targetField = (DatabaseField)targetKeysEnum.nextElement(); method.addLine(mappingName + ".addTargetForeignKeyFieldName(\"" + targetField.getQualifiedName() + "\", \"" + sourceField.getQualifiedName() + "\");"); } }
protected void addOneToManyMappingLines(NonreflectiveMethodDefinition method, String mappingName, OneToManyMapping mapping) { Enumeration targetKeysEnum = mapping.getTargetForeignKeyFields().elements(); Enumeration sourceKeysEnum = mapping.getSourceKeyFields().elements(); while (sourceKeysEnum.hasMoreElements()) { DatabaseField sourceField = (DatabaseField)sourceKeysEnum.nextElement(); DatabaseField targetField = (DatabaseField)targetKeysEnum.nextElement(); method.addLine(mappingName + ".addTargetForeignKeyFieldName(\"" + targetField.getQualifiedName() + "\", \"" + sourceField.getQualifiedName() + "\");"); } }
protected void addOneToManyMappingLines(NonreflectiveMethodDefinition method, String mappingName, OneToManyMapping mapping) { Enumeration targetKeysEnum = mapping.getTargetForeignKeyFields().elements(); Enumeration sourceKeysEnum = mapping.getSourceKeyFields().elements(); while (sourceKeysEnum.hasMoreElements()) { DatabaseField sourceField = (DatabaseField)sourceKeysEnum.nextElement(); DatabaseField targetField = (DatabaseField)targetKeysEnum.nextElement(); method.addLine(mappingName + ".addTargetForeignKeyFieldName(\"" + targetField.getQualifiedName() + "\", \"" + sourceField.getQualifiedName() + "\");"); } }
public void setAttributeValueInObject(Object object, Object value) { OneToManyMapping mapping = (OneToManyMapping)object; List associations = (List)value; mapping.setSourceKeyFields(NonSynchronizedVector.newInstance(associations.size())); mapping.setTargetForeignKeyFields(NonSynchronizedVector.newInstance(associations.size())); Iterator iterator = associations.iterator(); while (iterator.hasNext()) { Association association = (Association)iterator.next(); mapping.getSourceKeyFields().add((DatabaseField)association.getValue()); mapping.getTargetForeignKeyFields().add((DatabaseField)association.getKey()); } } });