Class PBaseCompareable<R,​T>

    • Constructor Detail

      • PBaseCompareable

        public PBaseCompareable​(String name,
                                R root)
        Construct with a property name and root instance.
        Parameters:
        name - property name
        root - the root query bean instance
      • PBaseCompareable

        public PBaseCompareable​(String name,
                                R root,
                                String prefix)
        Construct with additional path prefix.
    • Method Detail

      • gt

        public final R gt​(T value)
        Greater than.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • gtOrNull

        public final R gtOrNull​(T value)
        Greater than OR Null.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • ge

        public final R ge​(T value)
        Greater than or Equal to.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • geOrNull

        public final R geOrNull​(T value)
        Greater than or Equal to OR Null.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • lt

        public final R lt​(T value)
        Less than.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • ltOrNull

        public final R ltOrNull​(T value)
        Less than OR Null.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • le

        public final R le​(T value)
        Less than or Equal to.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • leOrNull

        public final R leOrNull​(T value)
        Less than or Equal to.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • inRange

        public final R inRange​(T lower,
                               T upper)
        Greater or equal to lower value and strictly less than upper value.

        This is generally preferable over Between for date and datetime types as SQL Between is inclusive on the upper bound (<= ) and generally we need the upper bound to be exclusive (< ).

        Parameters:
        lower - the lower bind value (>= )
        upper - the upper bind value (< )
        Returns:
        the root query bean instance
      • inRangeWith

        public final R inRangeWith​(TQProperty<R> highProperty,
                                   T value)
        Value in Range between 2 properties.
        
        
            .startDate.inRangeWith(endDate, now)
        
            // which equates to
            startDate <= now and (endDate > now or endDate is null)
        
         

        This is a convenience expression combining a number of simple expressions. The most common use of this could be called "effective dating" where 2 date or timestamp columns represent the date range in which

      • between

        public final R between​(T lower,
                               T upper)
        Between lower and upper values.
        Parameters:
        lower - the lower bind value
        upper - the upper bind value
        Returns:
        the root query bean instance
      • greaterThan

        public final R greaterThan​(T value)
        Greater than.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • greaterThanOrNull

        public final R greaterThanOrNull​(T value)
        Greater than or Null.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • greaterOrEqualTo

        public final R greaterOrEqualTo​(T value)
        Greater than or Equal to.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • lessThan

        public final R lessThan​(T value)
        Less than.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • lessThanOrNull

        public final R lessThanOrNull​(T value)
        Less than or Null.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance
      • lessOrEqualTo

        public final R lessOrEqualTo​(T value)
        Less than or Equal to.
        Parameters:
        value - the bind value
        Returns:
        the root query bean instance