mapping.setJPAType(jpaAttribute.getJavaType());
navProp.setMapping((Mapping) mapping);
String jpaEntityTypeName = propertyView.getJPAEdmEntityTypeView()
.getJPAEntityType().getName();
JPAEdmMappingModelAccess mappingModelAccess = navPropertyView
.getJPAEdmMappingModelAccess();
String targetEntityTypeName = null;
if (jpaAttribute.isCollection()) {
targetEntityTypeName = ((PluralAttribute<?, ?, ?>) jpaAttribute).getElementType().getJavaType().getSimpleName();
} else {
targetEntityTypeName = jpaAttribute.getJavaType().getSimpleName();
}
if (mappingModelAccess != null
&& mappingModelAccess.isMappingModelExists()) {
navPropName = mappingModelAccess.mapJPARelationship(
jpaEntityTypeName, jpaAttribute.getName());
toName = mappingModelAccess.mapJPAEntityType(targetEntityTypeName);
fromName = mappingModelAccess
.mapJPAEntityType(jpaEntityTypeName);
}
if (toName == null) {
toName = targetEntityTypeName;
}