String role) {
CollectionMetadata cm = sessionFactory.getCollectionMetadata(role);
// FIXME buildCollectionType
if (null == cm) { return null; }
org.hibernate.type.Type type = cm.getElementType();
EntityType elementType = null;
if (type.isEntityType()) {
elementType = (EntityType) entityTypes.get(type.getName());
if (null == elementType) {
elementType = buildEntityType(sessionFactory, type.getName());
}
} else {
elementType = new EntityType(type.getReturnedClass());
}
CollectionType collectionType = new CollectionType();
collectionType.setElementType(elementType);
collectionType.setArray(cm.isArray());