Class Restrictions


  • public class Restrictions
    extends java.lang.Object
    Factory for creating criterion instances.
    Since:
    1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      Restrictions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static QueryModel.Criterion and​(QueryModel.Criterion a, QueryModel.Criterion b)
      Logical OR.
      static QueryModel.Between between​(java.lang.String property, java.lang.Object start, java.lang.Object end)
      Restricts the results by the given property value range.
      static QueryModel.Contains contains​(java.lang.String property, java.lang.Object expression)
      Restricts the property match to strings containing the given value.
      static QueryModel.EndsWith endsWith​(java.lang.String property, java.lang.Object expression)
      Restricts the property match to strings ending with the given value.
      static QueryModel.Equals eq​(java.lang.String property, java.lang.Object parameter)
      Restricts the property to be equal to the given value.
      static QueryModel.EqualsProperty eqProperty​(java.lang.String propertyName, java.lang.String otherPropertyName)
      Constraints a property to be equal to a specified other property.
      static QueryModel.GreaterThanEqualsProperty geProperty​(java.lang.String propertyName, java.lang.String otherPropertyName)
      Constraints a property to be greater than or equal to a specified other property.
      static QueryModel.GreaterThan gt​(java.lang.String property, java.lang.Object parameter)
      Used to restrict a value to be greater than the given value.
      static QueryModel.GreaterThanEquals gte​(java.lang.String property, java.lang.Object parameter)
      Used to restrict a value to be greater than or equal to the given value.
      static QueryModel.GreaterThanProperty gtProperty​(java.lang.String propertyName, java.lang.String otherPropertyName)
      Constraints a property to be greater than a specified other property.
      static QueryModel.IdEquals idEq​(java.lang.Object parameter)
      Restricts the property to be equal to the given value.
      static QueryModel.ILike ilike​(java.lang.String property, java.lang.Object expression)
      Case insensitive like.
      static QueryModel.In in​(java.lang.String property, QueryModel subquery)
      Restricts the property to be in the list of given values.
      static QueryModel.In in​(java.lang.String property, java.lang.Object parameter)
      Restricts the property to be in the list of given values.
      static QueryModel.IsEmpty isEmpty​(java.lang.String property)
      Used to restrict a value to be empty (such as a blank string or an empty collection).
      static QueryModel.IsFalse isFalse​(java.lang.String property)
      Used to restrict a value to be false.
      static QueryModel.IsNotEmpty isNotEmpty​(java.lang.String property)
      Used to restrict a value to be not empty (such as a non-blank string).
      static QueryModel.IsNotNull isNotNull​(java.lang.String property)
      Used to restrict a value to be null.
      static QueryModel.IsNull isNull​(java.lang.String property)
      Used to restrict a value to be null.
      static QueryModel.IsTrue isTrue​(java.lang.String property)
      Used to restrict a value to be true.
      static QueryModel.LessThanEqualsProperty leProperty​(java.lang.String propertyName, java.lang.String otherPropertyName)
      Constraints a property to be less than or equal to a specified other property.
      static QueryModel.Like like​(java.lang.String property, java.lang.Object expression)
      Restricts the property match the given String expressions.
      static QueryModel.LessThan lt​(java.lang.String property, java.lang.Object parameter)
      Used to restrict a value to be less than the given value.
      static QueryModel.LessThanEquals lte​(java.lang.String property, java.lang.Object parameter)
      Used to restrict a value to be less than or equal to the given value.
      static QueryModel.LessThanProperty ltProperty​(java.lang.String propertyName, java.lang.String otherPropertyName)
      Constraints a property to be less than a specified other property.
      static QueryModel.NotEquals ne​(java.lang.String property, java.lang.Object parameter)
      Restricts the property to be not equal to the given value.
      static QueryModel.NotEqualsProperty neProperty​(java.lang.String propertyName, java.lang.String otherPropertyName)
      Constraints a property to be not equal to a specified other property.
      static QueryModel.NotIn notIn​(java.lang.String property, QueryModel subquery)
      Restricts the property to be in the list of given values.
      static QueryModel.NotIn notIn​(java.lang.String property, java.lang.Object parameter)
      Restricts the property to not be in the list of given values.
      static QueryModel.Criterion or​(QueryModel.Criterion a, QueryModel.Criterion b)
      Logical OR.
      static QueryModel.Regex regex​(java.lang.String property, java.lang.Object expression)
      Restricts the property match the given regex expressions.
      static QueryModel.RLike rlike​(java.lang.String property, java.lang.Object expression)
      Restricts the property match the given regular expressions.
      static QueryModel.SizeEquals sizeEq​(java.lang.String property, java.lang.Object size)
      Used to restrict the size of a collection property.
      static QueryModel.SizeGreaterThanEquals sizeGe​(java.lang.String property, java.lang.Object size)
      Used to restrict the size of a collection property to be greater than or equal to the given value.
      static QueryModel.SizeGreaterThan sizeGt​(java.lang.String property, java.lang.Object size)
      Used to restrict the size of a collection property to be greater than the given value.
      static QueryModel.SizeLessThanEquals sizeLe​(java.lang.String property, java.lang.Object size)
      Creates a Criterion that contrains a collection property to be less than or equal to the given size.
      static QueryModel.SizeLessThan sizeLt​(java.lang.String property, java.lang.Object size)
      Creates a Criterion that contrains a collection property to be less than to the given size.
      static QueryModel.SizeNotEquals sizeNe​(java.lang.String property, java.lang.Object size)
      Creates a Criterion that contrains a collection property to be not equal to the given size.
      static QueryModel.StartsWith startsWith​(java.lang.String property, java.lang.Object expression)
      Restricts the property match to strings starting with the given value.
      static QueryModel.VersionEquals versionEq​(java.lang.Object parameter)
      Restricts the property to be equal to the given value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Restrictions

        public Restrictions()
    • Method Detail

      • eq

        public static QueryModel.Equals eq​(java.lang.String property,
                                           java.lang.Object parameter)
        Restricts the property to be equal to the given value.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        An instance of Query.Equals
      • idEq

        public static QueryModel.IdEquals idEq​(java.lang.Object parameter)
        Restricts the property to be equal to the given value.
        Parameters:
        parameter - The parameter that provides the value
        Returns:
        An instance of Query.Equals
      • versionEq

        public static QueryModel.VersionEquals versionEq​(java.lang.Object parameter)
        Restricts the property to be equal to the given value.
        Parameters:
        parameter - The parameter that provides the value
        Returns:
        An instance of Query.Equals
      • ne

        public static QueryModel.NotEquals ne​(java.lang.String property,
                                              java.lang.Object parameter)
        Restricts the property to be not equal to the given value.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        An instance of Query.Equals
      • in

        public static QueryModel.In in​(java.lang.String property,
                                       java.lang.Object parameter)
        Restricts the property to be in the list of given values.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        An instance of Query.In
      • notIn

        public static QueryModel.NotIn notIn​(java.lang.String property,
                                             java.lang.Object parameter)
        Restricts the property to not be in the list of given values.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        An instance of Query.In
      • in

        public static QueryModel.In in​(java.lang.String property,
                                       QueryModel subquery)
        Restricts the property to be in the list of given values.
        Parameters:
        property - The property
        subquery - The subquery
        Returns:
        An instance of Query.In
      • notIn

        public static QueryModel.NotIn notIn​(java.lang.String property,
                                             QueryModel subquery)
        Restricts the property to be in the list of given values.
        Parameters:
        property - The property
        subquery - The subquery
        Returns:
        An instance of Query.In
      • like

        public static QueryModel.Like like​(java.lang.String property,
                                           java.lang.Object expression)
        Restricts the property match the given String expressions. Expressions use SQL-like % to denote wildcards
        Parameters:
        property - The property name
        expression - The expression
        Returns:
        An instance of Query.Like
      • regex

        public static QueryModel.Regex regex​(java.lang.String property,
                                             java.lang.Object expression)
        Restricts the property match the given regex expressions.
        Parameters:
        property - The property name
        expression - The expression
        Returns:
        An instance of Query.Like
      • startsWith

        public static QueryModel.StartsWith startsWith​(java.lang.String property,
                                                       java.lang.Object expression)
        Restricts the property match to strings starting with the given value.
        Parameters:
        property - The property name
        expression - The expression
        Returns:
        An instance of Query.StartsWith
      • contains

        public static QueryModel.Contains contains​(java.lang.String property,
                                                   java.lang.Object expression)
        Restricts the property match to strings containing the given value.
        Parameters:
        property - The property name
        expression - The expression
        Returns:
        An instance of Query.Constains
      • endsWith

        public static QueryModel.EndsWith endsWith​(java.lang.String property,
                                                   java.lang.Object expression)
        Restricts the property match to strings ending with the given value.
        Parameters:
        property - The property name
        expression - The expression
        Returns:
        An instance of Query.EndsWith
      • ilike

        public static QueryModel.ILike ilike​(java.lang.String property,
                                             java.lang.Object expression)
        Case insensitive like.
        Parameters:
        property - The property
        expression - The expression
        Returns:
        An ILike expression
      • rlike

        public static QueryModel.RLike rlike​(java.lang.String property,
                                             java.lang.Object expression)
        Restricts the property match the given regular expressions.
        Parameters:
        property - The property name
        expression - The expression
        Returns:
        An instance of Query.RLike
      • between

        public static QueryModel.Between between​(java.lang.String property,
                                                 java.lang.Object start,
                                                 java.lang.Object end)
        Restricts the results by the given property value range.
        Parameters:
        property - The name of the property
        start - The start of the range
        end - The end of the range
        Returns:
        The Between instance
      • gt

        public static QueryModel.GreaterThan gt​(java.lang.String property,
                                                java.lang.Object parameter)
        Used to restrict a value to be greater than the given value.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        The GreaterThan instance
      • lt

        public static QueryModel.LessThan lt​(java.lang.String property,
                                             java.lang.Object parameter)
        Used to restrict a value to be less than the given value.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        The LessThan instance
      • gte

        public static QueryModel.GreaterThanEquals gte​(java.lang.String property,
                                                       java.lang.Object parameter)
        Used to restrict a value to be greater than or equal to the given value.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        The LessThan instance
      • lte

        public static QueryModel.LessThanEquals lte​(java.lang.String property,
                                                    java.lang.Object parameter)
        Used to restrict a value to be less than or equal to the given value.
        Parameters:
        property - The property
        parameter - The parameter that provides the value
        Returns:
        The LessThan instance
      • isNull

        public static QueryModel.IsNull isNull​(java.lang.String property)
        Used to restrict a value to be null.
        Parameters:
        property - The property name
        Returns:
        The IsNull instance
      • isEmpty

        public static QueryModel.IsEmpty isEmpty​(java.lang.String property)
        Used to restrict a value to be empty (such as a blank string or an empty collection).
        Parameters:
        property - The property name
        Returns:
        The IsEmpty instance
      • isNotEmpty

        public static QueryModel.IsNotEmpty isNotEmpty​(java.lang.String property)
        Used to restrict a value to be not empty (such as a non-blank string).
        Parameters:
        property - The property name
        Returns:
        The IsEmpty instance
      • isNotNull

        public static QueryModel.IsNotNull isNotNull​(java.lang.String property)
        Used to restrict a value to be null.
        Parameters:
        property - The property name
        Returns:
        The IsNull instance
      • isTrue

        public static QueryModel.IsTrue isTrue​(java.lang.String property)
        Used to restrict a value to be true.
        Parameters:
        property - The property name
        Returns:
        The true instance
      • isFalse

        public static QueryModel.IsFalse isFalse​(java.lang.String property)
        Used to restrict a value to be false.
        Parameters:
        property - The property name
        Returns:
        The true instance
      • sizeEq

        public static QueryModel.SizeEquals sizeEq​(java.lang.String property,
                                                   java.lang.Object size)
        Used to restrict the size of a collection property.
        Parameters:
        property - The property
        size - The size to restrict
        Returns:
        The result
      • sizeGt

        public static QueryModel.SizeGreaterThan sizeGt​(java.lang.String property,
                                                        java.lang.Object size)
        Used to restrict the size of a collection property to be greater than the given value.
        Parameters:
        property - The property
        size - The size to restrict
        Returns:
        The result
      • sizeGe

        public static QueryModel.SizeGreaterThanEquals sizeGe​(java.lang.String property,
                                                              java.lang.Object size)
        Used to restrict the size of a collection property to be greater than or equal to the given value.
        Parameters:
        property - The property
        size - The size to restrict
        Returns:
        The result
      • sizeLe

        public static QueryModel.SizeLessThanEquals sizeLe​(java.lang.String property,
                                                           java.lang.Object size)
        Creates a Criterion that contrains a collection property to be less than or equal to the given size.
        Parameters:
        property - The property name
        size - The size to constrain by
        Returns:
        A Criterion instance
      • sizeLt

        public static QueryModel.SizeLessThan sizeLt​(java.lang.String property,
                                                     java.lang.Object size)
        Creates a Criterion that contrains a collection property to be less than to the given size.
        Parameters:
        property - The property name
        size - The size to constrain by
        Returns:
        A Criterion instance
      • sizeNe

        public static QueryModel.SizeNotEquals sizeNe​(java.lang.String property,
                                                      java.lang.Object size)
        Creates a Criterion that contrains a collection property to be not equal to the given size.
        Parameters:
        property - The property name
        size - The size to constrain by
        Returns:
        A Criterion instance
      • eqProperty

        public static QueryModel.EqualsProperty eqProperty​(java.lang.String propertyName,
                                                           java.lang.String otherPropertyName)
        Constraints a property to be equal to a specified other property.
        Parameters:
        propertyName - The property
        otherPropertyName - The other property
        Returns:
        The criterion instance
      • neProperty

        public static QueryModel.NotEqualsProperty neProperty​(java.lang.String propertyName,
                                                              java.lang.String otherPropertyName)
        Constraints a property to be not equal to a specified other property.
        Parameters:
        propertyName - The property
        otherPropertyName - The other property
        Returns:
        This criterion instance
      • gtProperty

        public static QueryModel.GreaterThanProperty gtProperty​(java.lang.String propertyName,
                                                                java.lang.String otherPropertyName)
        Constraints a property to be greater than a specified other property.
        Parameters:
        propertyName - The property
        otherPropertyName - The other property
        Returns:
        The criterion
      • geProperty

        public static QueryModel.GreaterThanEqualsProperty geProperty​(java.lang.String propertyName,
                                                                      java.lang.String otherPropertyName)
        Constraints a property to be greater than or equal to a specified other property.
        Parameters:
        propertyName - The property
        otherPropertyName - The other property
        Returns:
        The criterion
      • ltProperty

        public static QueryModel.LessThanProperty ltProperty​(java.lang.String propertyName,
                                                             java.lang.String otherPropertyName)
        Constraints a property to be less than a specified other property.
        Parameters:
        propertyName - The property
        otherPropertyName - The other property
        Returns:
        The criterion
      • leProperty

        public static QueryModel.LessThanEqualsProperty leProperty​(java.lang.String propertyName,
                                                                   java.lang.String otherPropertyName)
        Constraints a property to be less than or equal to a specified other property.
        Parameters:
        propertyName - The property
        otherPropertyName - The other property
        Returns:
        The criterion