String reverseName = relationship.getReverseRelationshipName();
Property property;
if (relationship.isToMany()) {
PropertyAccessor accessor = makeAccessor(
relationship.getName(),
List.class);
if (dataObject) {
property = new ToManyListProperty(
this,
targetDescriptor,
accessor,
reverseName);
}
else {
property = new ListProperty(
this,
targetDescriptor,
accessor,
reverseName);
}
}
else {
if (dataObject) {
ObjEntity targetEntity = (ObjEntity) relationship.getTargetEntity();
PropertyAccessor accessor = makeAccessor(
relationship.getName(),
targetEntity.getJavaClass());
property = new PersistentObjectProperty(
this,
targetDescriptor,
accessor,
reverseName);
}
else {
PropertyAccessor accessor = makeAccessor(
relationship.getName(),
ValueHolder.class);
property = new ValueHolderProperty(
this,
targetDescriptor,