Class QueryUtil
- java.lang.Object
-
- com.devonfw.module.jpa.dataaccess.api.QueryHelper
-
- com.devonfw.module.jpa.dataaccess.api.QueryUtil
-
public class QueryUtil extends QueryHelper
Helper class forstatic accessto features ofQueryHelper.- Since:
- 3.0.0
-
-
Field Summary
-
Fields inherited from class com.devonfw.module.jpa.dataaccess.api.QueryHelper
QUERY_PROPERTY_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description QueryUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <E> org.springframework.data.domain.Page<E>findPaginated(org.springframework.data.domain.Pageable pageable, com.querydsl.jpa.impl.JPAQuery<E> query, boolean determineTotal)Returns aPageof entities according to the suppliedPageableandJPAQuery.static QueryUtilget()<T> com.querydsl.core.types.dsl.BooleanExpressionnewInClause(com.querydsl.core.types.dsl.SimpleExpression<T> expression, Collection<T> inValues)com.querydsl.core.types.dsl.BooleanExpressionnewLikeClause(com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)com.querydsl.core.types.dsl.BooleanExpressionnewLikeClause(com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring, boolean negate)com.querydsl.core.types.dsl.BooleanExpressionnewNotLikeClause(com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)com.querydsl.core.types.dsl.BooleanExpressionnewStringClause(com.querydsl.core.types.dsl.StringExpression expression, String value, StringSearchConfigTo config)com.querydsl.core.types.dsl.BooleanExpressionnewStringClause(com.querydsl.core.types.dsl.StringExpression expression, String value, StringSearchOperator operator, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)<T> voidwhereIn(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.SimpleExpression<T> expression, Collection<T> inValues)voidwhereLike(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)voidwhereNotLike(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)voidwhereString(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.StringExpression expression, String value, StringSearchConfigTo config)-
Methods inherited from class com.devonfw.module.jpa.dataaccess.api.QueryHelper
applySort, applyTimeout, findPaginatedGeneric
-
-
-
-
Method Detail
-
whereLike
public void whereLike(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)- Overrides:
whereLikein classQueryHelper- Parameters:
query- theJPAQueryto modify.expression- theStringExpressiontocreate the LIKE-clausefrom.pattern- the pattern for the LIKE-clause to create.syntax- theLikePatternSyntaxof the givenpattern.ignoreCase- -trueto ignore the case,falseotherwise (to search case-sensitive).matchSubstring- -trueto match also if the givenpatternshall also match substrings on the givenStringExpression.
-
newLikeClause
public com.querydsl.core.types.dsl.BooleanExpression newLikeClause(com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring, boolean negate)- Overrides:
newLikeClausein classQueryHelper- Parameters:
expression- theStringExpressiontocreate the LIKE-clausefrom.pattern- the pattern for the LIKE-clause to create.syntax- theLikePatternSyntaxof the givenpattern.ignoreCase- -trueto ignore the case,falseotherwise (to search case-sensitive).matchSubstring- -trueto match also if the givenpatternshall also match substrings on the givenStringExpression.negate- -trueforNOT LIKE,falseforLIKE.- Returns:
- the LIKE-clause as
BooleanExpression.
-
newStringClause
public com.querydsl.core.types.dsl.BooleanExpression newStringClause(com.querydsl.core.types.dsl.StringExpression expression, String value, StringSearchConfigTo config)- Overrides:
newStringClausein classQueryHelper- Parameters:
expression- theStringExpressionto search on.value- the string value or pattern to search for.config- theStringSearchConfigToto configure the search. May benullfor regular equals search as default fallback.- Returns:
- the new
BooleanExpressionfor the specified string comparison clause.
-
newStringClause
public com.querydsl.core.types.dsl.BooleanExpression newStringClause(com.querydsl.core.types.dsl.StringExpression expression, String value, StringSearchOperator operator, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)- Overrides:
newStringClausein classQueryHelper- Parameters:
expression- theStringExpressionto search on.value- the string value or pattern to search for.operator- theStringSearchOperatorused to compare the search stringvalue.syntax- theLikePatternSyntaxof the givenpattern.ignoreCase- -trueto ignore the case,falseotherwise (to search case-sensitive).matchSubstring- -trueto match also if the givenpatternshall also match substrings on the givenStringExpression.- Returns:
- the new
BooleanExpressionfor the specified string comparison clause.
-
whereString
public void whereString(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.StringExpression expression, String value, StringSearchConfigTo config)- Overrides:
whereStringin classQueryHelper- Parameters:
query- theJPAQueryto modify.expression- theStringExpressionto search on.value- the string value or pattern to search for.config- theStringSearchConfigToto configure the search. May benullfor regular equals search.
-
whereNotLike
public void whereNotLike(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)- Overrides:
whereNotLikein classQueryHelper- Parameters:
query- theJPAQueryto modify.expression- theStringExpressiontocreate the NOT LIKE-clausefrom.pattern- the pattern for the NOT LIKE-clause to create.syntax- theLikePatternSyntaxof the givenpattern.ignoreCase- -trueto ignore the case,falseotherwise (to search case-sensitive).matchSubstring- -trueto match also if the givenpatternshall also match substrings on the givenStringExpression.
-
newLikeClause
public com.querydsl.core.types.dsl.BooleanExpression newLikeClause(com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)- Overrides:
newLikeClausein classQueryHelper- Parameters:
expression- theStringExpressiontocreate the LIKE-clausefrom.pattern- the pattern for the LIKE-clause to create.syntax- theLikePatternSyntaxof the givenpattern.ignoreCase- -trueto ignore the case,falseotherwise (to search case-sensitive).matchSubstring- -trueto match also if the givenpatternshall also match substrings on the givenStringExpression.- Returns:
- the LIKE-clause as
BooleanExpression.
-
newNotLikeClause
public com.querydsl.core.types.dsl.BooleanExpression newNotLikeClause(com.querydsl.core.types.dsl.StringExpression expression, String pattern, LikePatternSyntax syntax, boolean ignoreCase, boolean matchSubstring)- Overrides:
newNotLikeClausein classQueryHelper- Parameters:
expression- theStringExpressiontocreate the NOT LIKE-clausefrom.pattern- the pattern for the NOT LIKE-clause to create.syntax- theLikePatternSyntaxof the givenpattern.ignoreCase- -trueto ignore the case,falseotherwise (to search case-sensitive).matchSubstring- -trueto match also if the givenpatternshall also match substrings on the givenStringExpression.- Returns:
- the NOT LIKE-clause as
BooleanExpression.
-
newInClause
public <T> com.querydsl.core.types.dsl.BooleanExpression newInClause(com.querydsl.core.types.dsl.SimpleExpression<T> expression, Collection<T> inValues)- Overrides:
newInClausein classQueryHelper- Type Parameters:
T- generic type of theCollectionvalues for theIN-clause(s).- Parameters:
expression- theSimpleExpressionused to create theIN-clause(s).inValues- theCollectionof values for theIN-clause(s).- Returns:
- the
BooleanExpressionfor theIN-clause(s) odernullifinValuesisnullorempty.
-
whereIn
public <T> void whereIn(com.querydsl.jpa.impl.JPAQuery<?> query, com.querydsl.core.types.dsl.SimpleExpression<T> expression, Collection<T> inValues)- Overrides:
whereInin classQueryHelper- Type Parameters:
T- generic type of theCollectionvalues for theIN-clause(s).- Parameters:
query- theJPAQuerywhere toaddtheIN-clause(s)from the other given parameters.expression- theSimpleExpressionused to create theIN-clause(s).inValues- theCollectionof values for theIN-clause(s).- See Also:
QueryHelper.newInClause(SimpleExpression, Collection)
-
findPaginated
public <E> org.springframework.data.domain.Page<E> findPaginated(org.springframework.data.domain.Pageable pageable, com.querydsl.jpa.impl.JPAQuery<E> query, boolean determineTotal)Returns aPageof entities according to the suppliedPageableandJPAQuery.- Type Parameters:
E- generic type of the entity.- Parameters:
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- -trueto determine thetotal number of hits,falseotherwise.- Returns:
- a paginated list.
-
-