Class DBMemberQueryUtil

java.lang.Object
com.jalios.jcms.dbmember.DBMemberQueryUtil

public class DBMemberQueryUtil extends Object
Provides utility methods to retrieve Hibernate Criterion suitable for DBMember query.
Since:
jcms-10.0.1
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember who have the specified clearance level.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember who have the specified Member as its explicit declared manager or not.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember enabled or disabled.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to search for enabled account suppoting either all authentication or external authentication only.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups and any of its descendant.
    static org.hibernate.criterion.Criterion
    getGroupCriterion(Collection<Group> groups, boolean includeGrpDescendant)
    Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember which are not in any of the specified groups and any of its descendant.
    static org.hibernate.criterion.Criterion
    getGroupOffCriterion(Collection<Group> groups, boolean includeGrpDescendant)
    Retrieve an Hibernate Criterion to retrieve DBMember which are not in any of the specified groups (and any of its descendant if specified).
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember guest or not guest.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember who have an explicit declared manager or not.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember who are ldapAccount or not.
    static org.hibernate.criterion.Criterion
    getLdapSyncCriterion(Boolean ldapSyncEnabled)
    Retrieve an Hibernate Criterion to retrieve DBMember who should be synchronized with LDAP.
    static org.hibernate.criterion.Criterion
    Return an Hibernate criterion suitable to find DBMember to synchronized with LDAP.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember matching specified text.
    static org.hibernate.criterion.Criterion
    getUsageCriterion(int usage)
    Retrieve an Hibernate Criterion to retrieve DBMember of the specified usage.
    static org.hibernate.criterion.Criterion
    Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DBMemberQueryUtil

      public DBMemberQueryUtil()
  • Method Details

    • getTextCriterion

      public static org.hibernate.criterion.Criterion getTextCriterion(String text)
      Retrieve an Hibernate Criterion to retrieve DBMember matching specified text.
      Parameters:
      text - text to search
      Returns:
      a Criterion or null if no text were requested
    • getGroupCriterion

      public static org.hibernate.criterion.Criterion getGroupCriterion(Collection<Group> groups)
      Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups and any of its descendant.
      Parameters:
      groups - a Collection of Group
      Returns:
      a Criterion or null if no groups were requested
    • getGroupCriterion

      public static org.hibernate.criterion.Criterion getGroupCriterion(Collection<Group> groups, boolean includeGrpDescendant)
      Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups.
      Parameters:
      groups - a Collection of Group
      includeGrpDescendant - true to search for member in all descendant of the specified groups, false to search for member explicitely declared in one of the specified group
      Returns:
      a Criterion or null if no groups were requested
    • getGroupOffCriterion

      public static org.hibernate.criterion.Criterion getGroupOffCriterion(Collection<Group> groups)
      Retrieve an Hibernate Criterion to retrieve DBMember which are not in any of the specified groups and any of its descendant.
      Parameters:
      groups - a Collection of Group to exclude
      Returns:
      a Criterion or null if no groups were requested
      Since:
      jcms-10.0.2 - JCMS-6619
    • getGroupOffCriterion

      public static org.hibernate.criterion.Criterion getGroupOffCriterion(Collection<Group> groups, boolean includeGrpDescendant)
      Retrieve an Hibernate Criterion to retrieve DBMember which are not in any of the specified groups (and any of its descendant if specified).
      Parameters:
      groups - a Collection of Group to exclude
      includeGrpDescendant - true to search for member in all descendant of the specified groups, false to search for member explicitely declared in one of the specified group
      Returns:
      a Criterion or null if no groups were requested
      Since:
      jcms-10.0.7 - JCMS-9425
    • getWorkspaceCriterion

      public static org.hibernate.criterion.Criterion getWorkspaceCriterion(Workspace ws)
      Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups.
      Parameters:
      ws - a Workspace to match
      Returns:
      a Criterion or null if no Workspace was specified
    • getUsageCriterion

      public static org.hibernate.criterion.Criterion getUsageCriterion(int usage)
      Retrieve an Hibernate Criterion to retrieve DBMember of the specified usage.
      Parameters:
      usage - a usage to match
      Returns:
      a Criterion or null if negative usage
    • getEnabledCriterion

      public static org.hibernate.criterion.Criterion getEnabledCriterion(Boolean enabled)
      Retrieve an Hibernate Criterion to retrieve DBMember enabled or disabled.
      Parameters:
      enabled - TRUE to search for enabled DBMember, FALSE to search for disabled Member, null to return null criterion
      Returns:
      a Criterion or null if null value specified
      Since:
      jcms-10.0.2 - JCMS-6619
    • getExternalAuthCriterion

      public static org.hibernate.criterion.Criterion getExternalAuthCriterion(Boolean externalAuth)
      Retrieve an Hibernate Criterion to search for enabled account suppoting either all authentication or external authentication only.
      Parameters:
      externalAuth - TRUE to search for enabled DBMember account supporting only external authentication, FALSE to search for enabled DBMember account supporting all authentication (local password and external), null to return null criterion.
      Returns:
      a Criterion or null if null value specified
      Since:
      jcms-10.0.6 / JCMS-9072
    • getGuestCriterion

      public static org.hibernate.criterion.Criterion getGuestCriterion(Boolean isGuest)
      Retrieve an Hibernate Criterion to retrieve DBMember guest or not guest.
      Parameters:
      isGuest - TRUE to search for guests DBMember, FALSE to search for non guests Member, null to return null criterion
      Returns:
      a Criterion or null if null value specified
      Since:
      jcms-10.0.6 - JCMS-9060
    • getLdapAccountCriterion

      public static org.hibernate.criterion.Criterion getLdapAccountCriterion(Boolean ldapAccount)
      Retrieve an Hibernate Criterion to retrieve DBMember who are ldapAccount or not.
      Parameters:
      ldapAccount - null to return a null Criterion, TRUE to retrieve a criterion for LDAP account only, FALSE to retrieve non LDAP account only.
      Returns:
      a Criertion or null if null was specified as ldapAccoutn argument
      Since:
      jcms-10.0.1 / JCMS-6340
    • getLdapSyncCriterion

      public static org.hibernate.criterion.Criterion getLdapSyncCriterion(Boolean ldapSyncEnabled)
      Retrieve an Hibernate Criterion to retrieve DBMember who should be synchronized with LDAP.
      Parameters:
      ldapSyncEnabled - null to return a null Criterion, TRUE to retrieve a criterion for DBMember to synchronized with LDAP, FALSE to retrieve DBMember for which LDAP synchronized is disabled.
      Returns:
      a Criertion or null if null was specified as ldapAccoutn argument
      Since:
      jcms-10.0.1 / JCMS-6340
    • getLdapSynchronizedCriterion

      public static org.hibernate.criterion.Criterion getLdapSynchronizedCriterion(Group group)
      Return an Hibernate criterion suitable to find DBMember to synchronized with LDAP.

      That is, DBMember mathing ALL the following criterion :

      • LDAP (i.e. with a valid last sync date),
      • account (i.e. with account usage)
      • with LDAP synchronisation enabled,
      • optionally belonging to the specified group or any of its subgroup
      Parameters:
      group - an optional group (may be null)
      Returns:
      an hibernate critertion, never return null.
    • getHasDeclaredManagerCriterion

      public static org.hibernate.criterion.Criterion getHasDeclaredManagerCriterion(Boolean hasDeclaredManager)
      Retrieve an Hibernate Criterion to retrieve DBMember who have an explicit declared manager or not.
      Parameters:
      hasDeclaredManager - null to return a null Criterion, TRUE to retrieve a criterion for Member an explicit declared manager, FALSE to retrieve Member without any explicit declared manager.
      Returns:
      a Criterion or null if null was specified as hasDeclaredManager argument
      Since:
      jcms-10.0.7 / JCMS-9477
    • getDeclaredManagerCriterion

      public static org.hibernate.criterion.Criterion getDeclaredManagerCriterion(Member mbr)
      Retrieve an Hibernate Criterion to retrieve DBMember who have the specified Member as its explicit declared manager or not.
      Parameters:
      mbr - the required Member manager to search (if null, null is returned)
      Returns:
      a Criterion or null if null was specified as mbr argument
      Since:
      jcms-10.0.7 / JCMS-9477
    • getClearanceLevelCriterion

      public static org.hibernate.criterion.Criterion getClearanceLevelCriterion(Set<Integer> levelSet)
      Retrieve an Hibernate Criterion to retrieve DBMember who have the specified clearance level.
      Parameters:
      levelSet - a set member clearance level or null if there is no filter on Member's clearance level
      Returns:
      a Criterion or null if null was specified as mbr argument
      Since:
      10.0.8 / JCMS-10746