Class QueryUtils


  • public final class QueryUtils
    extends Object
    Simple utility class to help create Tuple queries.
    Author:
    Thiago A. de Souza Weber
    • Method Detail

      • toSelectionRecursively

        public static javax.persistence.criteria.Selection<?> toSelectionRecursively​(javax.persistence.criteria.From<?,​?> from,
                                                                                     org.springframework.data.mapping.PropertyPath property)
        Validate and register, recursively, if need it, the joins and fields restrictions to be applies to the Tuple query.
        Parameters:
        from - the From that the PropertyPath expression is based on
        property - the PropertyPath to be add to the expression
        Returns:
        an Selection expression
        See Also:
        QueryUtilsAdapter.toExpressionRecursively(From, PropertyPath, boolean)
      • getCollectionArgumentType

        public static Class<?> getCollectionArgumentType​(Method method)
        Extract, based on the given Method, the ParameterizedType of collection object.
        Parameters:
        method - the read method from the projection class
        Returns:
        the ParameterizedType for the collection object