Search in sources :

Example 6 with PropertyMapping

use of org.hibernate.persister.entity.PropertyMapping in project hibernate-orm by hibernate.

the class QueryTranslatorImpl method getPropertyMapping.

PropertyMapping getPropertyMapping(String name) throws QueryException {
    PropertyMapping decorator = getDecoratedPropertyMapping(name);
    if (decorator != null) {
        return decorator;
    }
    String type = getType(name);
    if (type == null) {
        String role = getRole(name);
        if (role == null) {
            throw new QueryException("alias not found: " + name);
        }
        // .getElementPropertyMapping();
        return getCollectionPersister(role);
    } else {
        Queryable persister = getEntityPersister(type);
        if (persister == null) {
            throw new QueryException("persistent class not found: " + type);
        }
        return persister;
    }
}
Also used : QueryException(org.hibernate.QueryException) Queryable(org.hibernate.persister.entity.Queryable) PropertyMapping(org.hibernate.persister.entity.PropertyMapping)

Aggregations

PropertyMapping (org.hibernate.persister.entity.PropertyMapping)6 QueryException (org.hibernate.QueryException)3 CollectionPropertyMapping (org.hibernate.persister.collection.CollectionPropertyMapping)3 MappingException (org.hibernate.MappingException)2 Type (org.hibernate.type.Type)2 Map (java.util.Map)1 HibernateException (org.hibernate.HibernateException)1 ExpandingCompositeQuerySpace (org.hibernate.loader.plan.build.spi.ExpandingCompositeQuerySpace)1 JoinDefinedByMetadata (org.hibernate.loader.plan.spi.JoinDefinedByMetadata)1 QueryableCollection (org.hibernate.persister.collection.QueryableCollection)1 Queryable (org.hibernate.persister.entity.Queryable)1 CollectionType (org.hibernate.type.CollectionType)1 CompositeType (org.hibernate.type.CompositeType)1 EntityType (org.hibernate.type.EntityType)1