Class HibernateSearch<TYPE>
- java.lang.Object
-
- com.atlassian.confluence.impl.user.crowd.hibernate.HibernateSearch<TYPE>
-
- All Implemented Interfaces:
org.springframework.orm.hibernate5.HibernateCallback<List<TYPE>>
public final class HibernateSearch<TYPE> extends Object implements org.springframework.orm.hibernate5.HibernateCallback<List<TYPE>>
A HibernateCallback that executes anHQLQuery
against the database, converting parameters and results to the correct types.Construction is via two static methods, depending on the type of query. For user, group and directory queries, use
forEntities(long, EntityQuery)
. For membership queries, useforMemberships(long, MembershipQuery)
.- Since:
- 7.20.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<TYPE>
doInHibernate(org.hibernate.Session session)
static <T> HibernateSearch<T>
forEntities(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
Returns a HibernateSearch instance for a user or group query in a particular directory.static <T> HibernateSearch<T>
forEntities(com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
Returns a HibernateSearch instance for a user, group or directory query across all directories.static <T> HibernateSearch<T>
forMemberships(long directoryId, com.atlassian.crowd.search.query.membership.MembershipQuery<T> query)
Returns a HibernateSearch instance for a membership query in a particular directory.protected static <T> void
handle(org.hibernate.Session session, com.atlassian.crowd.search.hibernate.HQLQuery hqlQuery, org.hibernate.query.Query<T> hibernateQuery, int maxResults)
-
-
-
Method Detail
-
forEntities
public static <T> HibernateSearch<T> forEntities(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
Returns a HibernateSearch instance for a user or group query in a particular directory.
-
forEntities
public static <T> HibernateSearch<T> forEntities(com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
Returns a HibernateSearch instance for a user, group or directory query across all directories. Normally this is only used for searching for directories.
-
forMemberships
public static <T> HibernateSearch<T> forMemberships(long directoryId, com.atlassian.crowd.search.query.membership.MembershipQuery<T> query)
Returns a HibernateSearch instance for a membership query in a particular directory.
-
doInHibernate
public List<TYPE> doInHibernate(org.hibernate.Session session)
- Specified by:
doInHibernate
in interfaceorg.springframework.orm.hibernate5.HibernateCallback<TYPE>
-
handle
protected static <T> void handle(org.hibernate.Session session, com.atlassian.crowd.search.hibernate.HQLQuery hqlQuery, org.hibernate.query.Query<T> hibernateQuery, int maxResults)
-
-