public Object getAttributeValueFromObject(Object object) {
ClassDescriptor mapping = (ClassDescriptor)object;
Vector associations = mapping.getMultipleTablePrimaryKeyAssociations();
for (int index = 0; index < associations.size(); index++) {
Association association = (Association)associations.get(index);
association.setKey(new DatabaseField((String)association.getKey()));
association.setValue(new DatabaseField((String)association.getValue()));
}
return associations;
}
public void setAttributeValueInObject(Object object, Object value) {
ClassDescriptor mapping = (ClassDescriptor)object;
Vector associations = (Vector)value;
for (int index = 0; index < associations.size(); index++) {
Association association = (Association)associations.get(index);
association.setKey(((DatabaseField)association.getKey()).getQualifiedName());
association.setValue(((DatabaseField)association.getValue()).getQualifiedName());
}
mapping.setForeignKeyFieldNamesForMultipleTable(associations);
}
});
multipleTablesPrimaryKey.setAttributeName("multipleTablesPrimaryKeys");
multipleTablesPrimaryKey.setReferenceClass(Association.class);
multipleTablesPrimaryKey.setXPath(getPrimaryNamespaceXPath() + "multiple-table-primary-keys/" + getSecondaryNamespaceXPath() + "field-reference");
descriptor.addMapping(multipleTablesPrimaryKey);
XMLCompositeCollectionMapping multipleTables = new XMLCompositeCollectionMapping();
multipleTables.setReferenceClass(Association.class);
multipleTables.setXPath(getPrimaryNamespaceXPath() + "multiple-table-foreign-keys/" + getSecondaryNamespaceXPath() + "field-reference");
multipleTables.setAttributeAccessor(new AttributeAccessor() {
public Object getAttributeValueFromObject(Object object) {
ClassDescriptor mapping = (ClassDescriptor)object;
Vector associations = mapping.getMultipleTableForeignKeyAssociations();
for (int index = 0; index < associations.size(); index++) {
Association association = (Association)associations.get(index);
association.setKey(new DatabaseField((String)association.getKey()));
association.setValue(new DatabaseField((String)association.getValue()));
}
return associations;
}
public void setAttributeValueInObject(Object object, Object value) {