Class FilterQueryUtils


  • public class FilterQueryUtils
    extends Object
    Utilities for integrating Filter into Query.
    • Constructor Detail

      • FilterQueryUtils

        public FilterQueryUtils()
    • Method Detail

      • formOrderByClause

        public static String formOrderByClause​(@Nullable
                                               Sort sort)
        Forms an order by clause for a Hibernate query based on given arguments.
        Parameters:
        sort - the property and direction the query should be ordered by.
        Returns:
        an order by clause. Empty string if the orderByProperty argument is null or empty.
      • formRestrictionClause

        public static String formRestrictionClause​(@Nullable
                                                   Filters filters)
        Creates a CNF restriction clause from the given Filters list. FIXME The problem with this: it assumes the join is already there.
        Parameters:
        filters - A list of filtering properties arrays. Elements in each array will be in a disjunction (OR) with each other. Arrays will then be in a conjunction (AND) with each other. I.e. The filter will be in a conjunctive normal form. [0 OR 1 OR 2] AND [0 OR 1] AND [0 OR 1 OR 3]
        Returns:
        a string containing the clause, without the leading "WHERE" keyword.