/** * 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); } }
/** * 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); } }
/** * Checks if source key is specified or not. */ protected boolean isSourceKeySpecified() { return !(getSourceKeyFields().isEmpty()); }
/** * Checks if source key is specified or not. */ protected boolean isSourceKeySpecified() { return !(getSourceKeyFields().isEmpty()); }
/** * Checks if source key is specified or not. */ protected boolean isSourceKeySpecified() { return !(getSourceKeyFields().isEmpty()); }
/** * 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; }
/** * PUBLIC: * Define the target foreign key relationship in the 1-M aggregate collection mapping. * Both the target foreign key field and the source primary key field must be specified. */ public void addTargetForeignKeyField(DatabaseField targetForeignKey, DatabaseField sourceKey) { getTargetForeignKeyFields().addElement(targetForeignKey); getSourceKeyFields().addElement(sourceKey); }
/** * PUBLIC: * Define the target foreign key relationship in the 1-M aggregate collection mapping. * Both the target foreign key field and the source primary key field must be specified. */ @Override public void addTargetForeignKeyField(DatabaseField targetForeignKey, DatabaseField sourceKey) { getTargetForeignKeyFields().addElement(targetForeignKey); getSourceKeyFields().addElement(sourceKey); }
/** * PUBLIC: * Define the target foreign key relationship in the 1-M aggregate collection mapping. * Both the target foreign key field and the source primary key field must be specified. */ @Override public void addTargetForeignKeyField(DatabaseField targetForeignKey, DatabaseField sourceKey) { getTargetForeignKeyFields().addElement(targetForeignKey); getSourceKeyFields().addElement(sourceKey); }
@Override public Object getAttributeValueFromObject(Object object) { AggregateCollectionMapping mapping = (AggregateCollectionMapping)object; List sourceFields = mapping.getSourceKeyFields(); List targetFields = mapping.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) { AggregateCollectionMapping mapping = (AggregateCollectionMapping)object; List sourceFields = mapping.getSourceKeyFields(); List targetFields = mapping.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) { AggregateCollectionMapping mapping = (AggregateCollectionMapping)object; List sourceFields = mapping.getSourceKeyFields(); List targetFields = mapping.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 addAggregateCollectionMappingLines(NonreflectiveMethodDefinition method, String mappingName, AggregateCollectionMapping 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 addAggregateCollectionMappingLines(NonreflectiveMethodDefinition method, String mappingName, AggregateCollectionMapping 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 addAggregateCollectionMappingLines(NonreflectiveMethodDefinition method, String mappingName, AggregateCollectionMapping 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) { AggregateCollectionMapping mapping = (AggregateCollectionMapping)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()); } } });
@Override public void setAttributeValueInObject(Object object, Object value) { AggregateCollectionMapping mapping = (AggregateCollectionMapping)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()); } } });
public void setAttributeValueInObject(Object object, Object value) { AggregateCollectionMapping mapping = (AggregateCollectionMapping)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()); } } });