String entityName = ((OneToMany)collection.getElement()).getReferencedEntityName();
if (entityName != null) {
if (collection.isMap()) {
Type keyType = typeFactory.get(Class.forName(propertyType.getParameters().get(0).getFullName()));
Type valueType = typeFactory.get(Class.forName(entityName));
propertyType = new SimpleType(propertyType,
normalize(propertyType.getParameters().get(0), keyType),
normalize(propertyType.getParameters().get(1), valueType));
} else {
Type componentType = typeFactory.get(Class.forName(entityName));
propertyType = new SimpleType(propertyType,
normalize(propertyType.getParameters().get(0), componentType));
}
}
} else if (collection.getElement() instanceof Component) {
Component component = (Component)collection.getElement();