Package org.hibernate.metadata

Examples of org.hibernate.metadata.CollectionMetadata


    return entityType;
  }

  private CollectionType buildCollectionType(SessionFactory sessionFactory, Class<?> collectionClass,
      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());
    collectionType.setCollectionClass(collectionClass);
    if (!collectionTypes.containsKey(collectionType.getName())) {
      collectionTypes.put(collectionType.getName(), collectionType);
    }
    return collectionType;
View Full Code Here


    return entityType;
  }

  private CollectionType buildCollectionType(SessionFactory sessionFactory,
      Class<?> collectionClass, String role) {
    CollectionMetadata cm = sessionFactory.getCollectionMetadata(role);
    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());
    collectionType.setCollectionClass(collectionClass);
    if (!collectionTypes.containsKey(collectionType.getName())) {
      collectionTypes.put(collectionType.getName(), collectionType);
    }
    return collectionType;
View Full Code Here

    return entityType;
  }

  private CollectionType buildCollectionType(SessionFactory sessionFactory, Class<?> collectionClass,
      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());
    collectionType.setCollectionClass(collectionClass);
    if (!collectionTypes.containsKey(collectionType.getName())) {
      collectionTypes.put(collectionType.getName(), collectionType);
    }
    return collectionType;
View Full Code Here

TOP

Related Classes of org.hibernate.metadata.CollectionMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.