Class HibernateSearch<TYPE>


  • public final class HibernateSearch<TYPE>
    extends Object
    A HibernateCallback that executes an HQLQuery 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, use forMemberships(long, MembershipQuery).

    Since:
    7.20.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      • 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)