public class QueryHelper extends Object
QueryUtil.get().| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOG |
protected static String |
QUERY_PROPERTY_TIMEOUT
JPA query property to configure the timeout in milliseconds.
|
| Constructor and Description |
|---|
QueryHelper() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applySort(com.querydsl.jpa.impl.JPAQuery<?> query,
org.springframework.data.domain.Sort sort) |
protected void |
applyTimeout(com.querydsl.jpa.impl.JPAQuery<?> query,
Number timeout) |
private <E> com.querydsl.core.types.dsl.PathBuilder<E> |
findAlias(com.querydsl.jpa.impl.JPAQuery<E> query) |
protected <E> org.springframework.data.domain.Page<E> |
findPaginatedGeneric(org.springframework.data.domain.Pageable pageable,
com.querydsl.jpa.impl.JPAQuery<E> query,
boolean determineTotal)
Returns a
Page of entities according to the supplied Pageable and JPAQuery. |
protected <T> com.querydsl.core.types.dsl.BooleanExpression |
newInClause(com.querydsl.core.types.dsl.SimpleExpression<T> expression,
Collection<T> inValues) |
protected com.querydsl.core.types.dsl.BooleanExpression |
newLikeClause(com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring) |
protected com.querydsl.core.types.dsl.BooleanExpression |
newLikeClause(com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring,
boolean negate) |
protected com.querydsl.core.types.dsl.BooleanExpression |
newNotLikeClause(com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring) |
protected com.querydsl.core.types.dsl.BooleanExpression |
newStringClause(com.querydsl.core.types.dsl.StringExpression expression,
String value,
StringSearchConfigTo config) |
protected com.querydsl.core.types.dsl.BooleanExpression |
newStringClause(com.querydsl.core.types.dsl.StringExpression expression,
String value,
StringSearchOperator operator,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring) |
protected <T> void |
whereIn(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.SimpleExpression<T> expression,
Collection<T> inValues) |
protected void |
whereLike(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring) |
protected void |
whereNotLike(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring) |
protected void |
whereString(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.StringExpression expression,
String value,
StringSearchConfigTo config) |
private static final org.slf4j.Logger LOG
protected static final String QUERY_PROPERTY_TIMEOUT
protected void applyTimeout(com.querydsl.jpa.impl.JPAQuery<?> query,
Number timeout)
query - the JPAQuery to modify.timeout - the timeout in milliseconds.protected void whereLike(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring)
query - the JPAQuery to modify.expression - the StringExpression to create the LIKE-clause
from.pattern - the pattern for the LIKE-clause to create.syntax - the LikePatternSyntax of the given pattern.ignoreCase - - true to ignore the case, false otherwise (to search case-sensitive).matchSubstring - - true to match also if the given pattern shall also match substrings on the
given StringExpression.protected void whereNotLike(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring)
query - the JPAQuery to modify.expression - the StringExpression to create the NOT
LIKE-clause from.pattern - the pattern for the NOT LIKE-clause to create.syntax - the LikePatternSyntax of the given pattern.ignoreCase - - true to ignore the case, false otherwise (to search case-sensitive).matchSubstring - - true to match also if the given pattern shall also match substrings on the
given StringExpression.protected com.querydsl.core.types.dsl.BooleanExpression newLikeClause(com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring)
expression - the StringExpression to create the LIKE-clause
from.pattern - the pattern for the LIKE-clause to create.syntax - the LikePatternSyntax of the given pattern.ignoreCase - - true to ignore the case, false otherwise (to search case-sensitive).matchSubstring - - true to match also if the given pattern shall also match substrings on the
given StringExpression.BooleanExpression.protected com.querydsl.core.types.dsl.BooleanExpression newNotLikeClause(com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring)
expression - the StringExpression to create the NOT
LIKE-clause from.pattern - the pattern for the NOT LIKE-clause to create.syntax - the LikePatternSyntax of the given pattern.ignoreCase - - true to ignore the case, false otherwise (to search case-sensitive).matchSubstring - - true to match also if the given pattern shall also match substrings on the
given StringExpression.BooleanExpression.protected com.querydsl.core.types.dsl.BooleanExpression newLikeClause(com.querydsl.core.types.dsl.StringExpression expression,
String pattern,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring,
boolean negate)
expression - the StringExpression to create the LIKE-clause
from.pattern - the pattern for the LIKE-clause to create.syntax - the LikePatternSyntax of the given pattern.ignoreCase - - true to ignore the case, false otherwise (to search case-sensitive).matchSubstring - - true to match also if the given pattern shall also match substrings on the
given StringExpression.negate - - true for NOT LIKE, false for
LIKE.BooleanExpression.protected com.querydsl.core.types.dsl.BooleanExpression newStringClause(com.querydsl.core.types.dsl.StringExpression expression,
String value,
StringSearchConfigTo config)
expression - the StringExpression to search on.value - the string value or pattern to search for.config - the StringSearchConfigTo to configure the search. May be null for regular equals
search as default fallback.BooleanExpression for the specified string comparison clause.protected com.querydsl.core.types.dsl.BooleanExpression newStringClause(com.querydsl.core.types.dsl.StringExpression expression,
String value,
StringSearchOperator operator,
LikePatternSyntax syntax,
boolean ignoreCase,
boolean matchSubstring)
expression - the StringExpression to search on.value - the string value or pattern to search for.syntax - the LikePatternSyntax of the given pattern.operator - the StringSearchOperator used to compare the search string value.ignoreCase - - true to ignore the case, false otherwise (to search case-sensitive).matchSubstring - - true to match also if the given pattern shall also match substrings on the
given StringExpression.BooleanExpression for the specified string comparison clause.protected void whereString(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.StringExpression expression,
String value,
StringSearchConfigTo config)
query - the JPAQuery to modify.expression - the StringExpression to search on.value - the string value or pattern to search for.config - the StringSearchConfigTo to configure the search. May be null for regular equals
search.protected <T> com.querydsl.core.types.dsl.BooleanExpression newInClause(com.querydsl.core.types.dsl.SimpleExpression<T> expression,
Collection<T> inValues)
T - generic type of the Collection values for the IN-clause(s).expression - the SimpleExpression used to create the IN-clause(s).inValues - the Collection of values for the IN-clause(s).BooleanExpression for the IN-clause(s) oder
null if inValues is null or empty.protected <T> void whereIn(com.querydsl.jpa.impl.JPAQuery<?> query,
com.querydsl.core.types.dsl.SimpleExpression<T> expression,
Collection<T> inValues)
T - generic type of the Collection values for the IN-clause(s).query - the JPAQuery where to add the
IN-clause(s) from the other given parameters.expression - the SimpleExpression used to create the IN-clause(s).inValues - the Collection of values for the IN-clause(s).newInClause(SimpleExpression, Collection)protected <E> org.springframework.data.domain.Page<E> findPaginatedGeneric(org.springframework.data.domain.Pageable pageable,
com.querydsl.jpa.impl.JPAQuery<E> query,
boolean determineTotal)
Page of entities according to the supplied Pageable and JPAQuery.E - generic type of the entity.pageable - contains information about the requested page and sorting.query - is a query which is pre-configured with the desired conditions for the search.determineTotal - - true to determine the total number of hits,
false otherwise.protected void applySort(com.querydsl.jpa.impl.JPAQuery<?> query,
org.springframework.data.domain.Sort sort)
query - the JPAQuery to apply the Sort to.sort - the Sort to apply as ORDER BY to the given JPAQuery.private <E> com.querydsl.core.types.dsl.PathBuilder<E> findAlias(com.querydsl.jpa.impl.JPAQuery<E> query)
Copyright © 2014–2019 devon4j-Team. All rights reserved.