Package com.jalios.jcms.dbmember
Class DBMemberQueryUtil
- java.lang.Object
-
- com.jalios.jcms.dbmember.DBMemberQueryUtil
-
public class DBMemberQueryUtil extends java.lang.ObjectProvides utility methods to retrieve Hibernate Criterion suitable for DBMember query.- Since:
- jcms-10.0.1
-
-
Constructor Summary
Constructors Constructor Description DBMemberQueryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.hibernate.criterion.CriteriongetClearanceLevelCriterion(java.util.Set<java.lang.Integer> levelSet)Retrieve an Hibernate Criterion to retrieve DBMember who have the specified clearance level.static org.hibernate.criterion.CriteriongetDeclaredManagerCriterion(Member mbr)Retrieve an Hibernate Criterion to retrieve DBMember who have the specified Member as its explicit declared manager or not.static org.hibernate.criterion.CriteriongetEnabledCriterion(java.lang.Boolean enabled)Retrieve an Hibernate Criterion to retrieve DBMember enabled or disabled.static org.hibernate.criterion.CriteriongetExternalAuthCriterion(java.lang.Boolean externalAuth)Retrieve an Hibernate Criterion to search for enabled account suppoting either all authentication or external authentication only.static org.hibernate.criterion.CriteriongetGroupCriterion(java.util.Collection<Group> groups)Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups and any of its descendant.static org.hibernate.criterion.CriteriongetGroupCriterion(java.util.Collection<Group> groups, boolean includeGrpDescendant)Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups.static org.hibernate.criterion.CriteriongetGroupOffCriterion(java.util.Collection<Group> groups)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.CriteriongetGroupOffCriterion(java.util.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.CriteriongetGuestCriterion(java.lang.Boolean isGuest)Retrieve an Hibernate Criterion to retrieve DBMember guest or not guest.static org.hibernate.criterion.CriteriongetHasDeclaredManagerCriterion(java.lang.Boolean hasDeclaredManager)Retrieve an Hibernate Criterion to retrieve DBMember who have an explicit declared manager or not.static org.hibernate.criterion.CriteriongetLdapAccountCriterion(java.lang.Boolean ldapAccount)Retrieve an Hibernate Criterion to retrieve DBMember who are ldapAccount or not.static org.hibernate.criterion.CriteriongetLdapSyncCriterion(java.lang.Boolean ldapSyncEnabled)Retrieve an Hibernate Criterion to retrieve DBMember who should be synchronized with LDAP.static org.hibernate.criterion.CriteriongetLdapSynchronizedCriterion(Group group)Return an Hibernate criterion suitable to find DBMember to synchronized with LDAP.static org.hibernate.criterion.CriteriongetTextCriterion(java.lang.String text)Retrieve an Hibernate Criterion to retrieve DBMember matching specified text.static org.hibernate.criterion.CriteriongetUsageCriterion(int usage)Retrieve an Hibernate Criterion to retrieve DBMember of the specified usage.static org.hibernate.criterion.CriteriongetWorkspaceCriterion(Workspace ws)Retrieve an Hibernate Criterion to retrieve DBMember in at least one of the specified groups.
-
-
-
Method Detail
-
getTextCriterion
public static org.hibernate.criterion.Criterion getTextCriterion(java.lang.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(java.util.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(java.util.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 GroupincludeGrpDescendant- 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(java.util.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(java.util.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 excludeincludeGrpDescendant- 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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.util.Set<java.lang.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
-
-