StringUtilities.uncapitalize(relEntityName)
);
this.name = relName;
this.itemType = dataMap.getObjEntity(relEntityName).getJavaClass();
this.idsFieldDefinition =
new FieldDefinition(
StringUtilities.uncapitalize(relEntityName) +
AdaptrexEntityType.COLLECTION_IDS_NAME,
ExtTypeFormatter.AUTO
);
/*
* Get the methods to grab the join table and target table
*/
try {
joinGetter = declaringClass.getMethod(
"get" + StringUtilities.pluralize(joinTable.getSimpleName()));
targetGetter = joinTable.getMethod("get" + this.itemType.getSimpleName());
primarySetter = joinTable.getMethod("set" + declaringClass.getSimpleName(), declaringClass);
targetSetter = joinTable.getMethod("set" + this.itemType.getSimpleName(), this.itemType);
} catch (Exception e) {}
}
/*
* Flattened association
*/
else {
String relName = StringUtilities.singularize(relationship.getName());
this.idsFieldDefinition =
new FieldDefinition(
relName + AdaptrexEntityType.COLLECTION_IDS_NAME,
ExtTypeFormatter.AUTO
);
String capName = StringUtilities.capitalize(getName());