Class QueryUtil

    • Constructor Detail

      • QueryUtil

        public QueryUtil()
    • 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:
        whereLike in class QueryHelper
        Parameters:
        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.
      • 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:
        newLikeClause in class QueryHelper
        Parameters:
        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.
        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:
        newStringClause in class QueryHelper
        Parameters:
        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.
        Returns:
        the new BooleanExpression for 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:
        newStringClause in class QueryHelper
        Parameters:
        expression - the StringExpression to search on.
        value - the string value or pattern to search for.
        operator - the StringSearchOperator used to compare the search string value.
        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.
        Returns:
        the new BooleanExpression for 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:
        whereString in class QueryHelper
        Parameters:
        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.
      • 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:
        whereNotLike in class QueryHelper
        Parameters:
        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.
      • 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:
        newLikeClause in class QueryHelper
        Parameters:
        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.
        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:
        newNotLikeClause in class QueryHelper
        Parameters:
        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.
        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:
        newInClause in class QueryHelper
        Type Parameters:
        T - generic type of the Collection values for the IN-clause(s).
        Parameters:
        expression - the SimpleExpression used to create the IN-clause(s).
        inValues - the Collection of values for the IN-clause(s).
        Returns:
        the BooleanExpression for the IN-clause(s) oder null if inValues is null or empty.
      • whereIn

        public <T> void whereIn​(com.querydsl.jpa.impl.JPAQuery<?> query,
                                com.querydsl.core.types.dsl.SimpleExpression<T> expression,
                                Collection<T> inValues)
        Overrides:
        whereIn in class QueryHelper
        Type Parameters:
        T - generic type of the Collection values for the IN-clause(s).
        Parameters:
        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).
        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 a Page of entities according to the supplied Pageable and JPAQuery.
        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 - - true to determine the total number of hits, false otherwise.
        Returns:
        a paginated list.