R
- Type of the result for this query.I
- Type the QueryParameters for this query.public abstract class AbstractUserQuery<R,I extends UserQueryParameters> extends PropertyQuery<R,I>
Modifier and Type | Field and Description |
---|---|
static String |
ALIAS_TAGS
alias for tag entity in query
|
static String |
FILTER_STATUS_ALL
The Constant FILTER_STATUS_ALL defines the filter value to include all user status in list.
|
Constructor and Description |
---|
AbstractUserQuery() |
Modifier and Type | Method and Description |
---|---|
String |
buildQuery(I queryInstance)
Build the query
|
void |
buildSelectQuery(StringBuilder query,
I queryInstance) |
String |
getUserAlias()
Get the query prefix for the user
|
protected String[] |
getUserSearchFields(I queryInstance) |
protected void |
matchOnlyIfUserQuery(StringBuilder whereQuery,
StringBuilder helpWhere,
String prefix)
It takes the help where query and wraps it in such a way that it will only match if the class
is a user
|
protected boolean |
needTagInQuery(I queryInstance)
Whether the tag entity is needed in the query.
|
protected boolean |
renderCommonFilters(StringBuilder whereQuery,
String userObjectAlias,
String prefix,
I queryInstance)
Renders a restriction to exclude users having specific status.
|
protected boolean |
renderExcludeStatusFilter(StringBuilder whereQuery,
String userObjectAlias,
String prefix,
I queryInstance)
Renders a restriction to exclude users having specific status.
|
void |
renderGroupByClause(StringBuilder query,
I queryInstance)
Renders the grouping for this query.
|
protected boolean |
renderIncludeStatusFilter(StringBuilder whereQuery,
String userObjectAlias,
String prefix,
I queryInstance)
Renders a restriction to only include users having specific status.
|
protected void |
renderOrderbyClause(StringBuilder mainQuery,
I queryParameters)
Render the order by clause
|
protected boolean |
renderRoleFilter(StringBuilder mainQuery,
StringBuilder whereQuery,
String prefix,
I queryInstance)
Render the role filter.
|
String |
renderSubQueryTags(I queryInstance,
StringBuilder whereQuery,
String prefix)
Renders the subquery for tag filterings.
|
protected boolean |
renderUserSearch(StringBuilder whereQuery,
String prefix,
I queryInstance)
Renders the user search query.
|
protected void |
setupQueries()
Setup the query constants.
|
renderPropertyFilters
createInstance, postQueryExecution, renderSearch
public static final String FILTER_STATUS_ALL
public static final String ALIAS_TAGS
public String buildQuery(I queryInstance)
Query
buildQuery
in class Query<R,I extends UserQueryParameters>
queryInstance
- The query instance containing the necessary parameters and configurationpublic void buildSelectQuery(StringBuilder query, I queryInstance)
query
- The query to append the constructor to.queryInstance
- the current query instancepublic String getUserAlias()
protected String[] getUserSearchFields(I queryInstance)
queryInstance
- the query instanceprotected void matchOnlyIfUserQuery(StringBuilder whereQuery, StringBuilder helpWhere, String prefix)
whereQuery
- the where query to append it all tohelpWhere
- the hel whereprefix
- the prefix to useprotected boolean needTagInQuery(I queryInstance)
queryInstance
- the current query instanceprotected boolean renderCommonFilters(StringBuilder whereQuery, String userObjectAlias, String prefix, I queryInstance)
whereQuery
- the whereQuery to which the restriction will be addeduserObjectAlias
- alias used in query to identify user object (e.g. 'user')prefix
- the connector prefix (e.g. 'AND')queryInstance
- the query instanceprotected boolean renderExcludeStatusFilter(StringBuilder whereQuery, String userObjectAlias, String prefix, I queryInstance)
whereQuery
- the whereQuery to which the restriction will be addeduserObjectAlias
- alias used in query to identify user object (e.g. 'user')prefix
- the connector prefix (e.g. 'AND')queryInstance
- the query instancepublic void renderGroupByClause(StringBuilder query, I queryInstance)
query
- The query.queryInstance
- The query instance.protected boolean renderIncludeStatusFilter(StringBuilder whereQuery, String userObjectAlias, String prefix, I queryInstance)
whereQuery
- the whereQuery to which the restriction will be addeduserObjectAlias
- alias used in query to identify user object (e.g. 'user')prefix
- the connector prefix (e.g. 'AND')queryInstance
- the query instanceprotected void renderOrderbyClause(StringBuilder mainQuery, I queryParameters)
renderOrderbyClause
in class Query<R,I extends UserQueryParameters>
mainQuery
- the main queryqueryParameters
- the query instanceprotected boolean renderRoleFilter(StringBuilder mainQuery, StringBuilder whereQuery, String prefix, I queryInstance)
mainQuery
- the main query containing the selection clausewhereQuery
- the whereQuery to which the restriction will be addedprefix
- the connector prefix (e.g. 'AND')queryInstance
- the query instancepublic String renderSubQueryTags(I queryInstance, StringBuilder whereQuery, String prefix)
queryInstance
- The query instance.whereQuery
- The where query to append.prefix
- The prefix.protected boolean renderUserSearch(StringBuilder whereQuery, String prefix, I queryInstance)
whereQuery
- the where partprefix
- the connector prefix (e.g. 'AND')queryInstance
- the query instance holding the query parametersprotected void setupQueries()
setupQueries
in class Query<R,I extends UserQueryParameters>
Copyright © 2019 Communote team. All rights reserved.