}
return generateDirectMapping(property, descriptor, namespaceInfo);
}
private XMLInverseReferenceMapping generateInverseReferenceMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespace) {
XMLInverseReferenceMapping invMapping = new XMLInverseReferenceMapping();
if (isCollectionType(property.getType())) {
invMapping.setReferenceClassName(property.getGenericType().getQualifiedName());
} else {
invMapping.setReferenceClassName(property.getType().getQualifiedName());
}
invMapping.setAttributeName(property.getPropertyName());
String setMethodName = property.getInverseReferencePropertySetMethodName();
String getMethodName = property.getInverseReferencePropertyGetMethodName();
if (setMethodName != null && !setMethodName.equals(XMLConstants.EMPTY_STRING)) {
invMapping.setSetMethodName(setMethodName);
}
if (getMethodName != null && !getMethodName.equals(XMLConstants.EMPTY_STRING)) {
invMapping.setGetMethodName(getMethodName);
}
invMapping.setMappedBy(property.getInverseReferencePropertyName());
if (isCollectionType(property.getType())) {
JavaClass collectionType = property.getType();
if (areEquals(collectionType, Collection.class) || areEquals(collectionType, List.class)) {
collectionType = jotArrayList;
} else if (areEquals(collectionType, Set.class)) {
collectionType = jotHashSet;
}
invMapping.useCollectionClass(helper.getClassForJavaClass(collectionType));
}
return invMapping;
}