public final class QueryExpressions extends Object
| Modifier and Type | Method and Description | 
|---|---|
static AndSpecification | 
and(Specification<Composite> left,
   Specification<Composite> right,
   Specification<Composite>... optionalRight)
Create a new AND specification. 
 | 
static <T> AssociationFunction<T> | 
association(Association<T> association)
Create a new Query Template AssociationFunction. 
 | 
static <T> ManyAssociationContainsSpecification<T> | 
contains(ManyAssociation<T> manyAssoc,
        T value)
Create a new CONTAINS specification for a ManyAssociation. 
 | 
static <T> NamedAssociationContainsSpecification<T> | 
contains(NamedAssociation<T> namedAssoc,
        T value)
Create a new CONTAINS specification for a NamedAssociation. 
 | 
static <T> ContainsSpecification<T> | 
contains(Property<? extends Collection<T>> collectionProperty,
        T value)
Create a new CONTAINS specification for a Collection Property. 
 | 
static <T> ContainsSpecification<T> | 
contains(Property<? extends Collection<T>> collectionProperty,
        Variable variable)
Create a new CONTAINS specification for a Collection Property using named Variables. 
 | 
static <T> ContainsAllSpecification<T> | 
containsAll(Property<? extends Collection<T>> collectionProperty,
           Iterable<T> values)
Create a new CONTAINS ALL specification for a Collection Property. 
 | 
static <T> ContainsAllSpecification<T> | 
containsAllVariables(Property<? extends Collection<T>> collectionProperty,
                    Iterable<Variable> variables)
Create a new CONTAINS ALL specification for a Collection Property using named Variables. 
 | 
static <T> NamedAssociationContainsNameSpecification<T> | 
containsName(NamedAssociation<T> namedAssoc,
            String name)
Create a new CONTAINS NAME specification for a NamedAssociation. 
 | 
static <T> EqSpecification<String> | 
eq(Association<T> association,
  T value)
Create a new EQUALS specification for an Association. 
 | 
static <T> EqSpecification<T> | 
eq(Property<T> property,
  T value)
Create a new EQUALS specification for a Property. 
 | 
static <T> EqSpecification<T> | 
eq(Property<T> property,
  Variable variable)
Create a new EQUALS specification for a Property using a named Variable. 
 | 
static <T> GeSpecification<T> | 
ge(Property<T> property,
  T value)
Create a new GREATER OR EQUALS specification for a Property. 
 | 
static <T> GeSpecification<T> | 
ge(Property<T> property,
  Variable variable)
Create a new GREATER OR EQUALS specification for a Property using a named Variable. 
 | 
static <T> GtSpecification<T> | 
gt(Property<T> property,
  T value)
Create a new GREATER THAN specification for a Property. 
 | 
static <T> GtSpecification<T> | 
gt(Property<T> property,
  Variable variable)
Create a new GREATER THAN specification for a Property using a named Variable. 
 | 
static <T> AssociationNotNullSpecification<T> | 
isNotNull(Association<T> association)
Create a new NOT NULL specification for an Association. 
 | 
static <T> PropertyNotNullSpecification<T> | 
isNotNull(Property<T> property)
Create a new NOT NULL specification for a Property. 
 | 
static <T> AssociationNullSpecification<T> | 
isNull(Association<T> association)
Create a new NULL specification for an Association. 
 | 
static <T> PropertyNullSpecification<T> | 
isNull(Property<T> property)
Create a new NULL specification for a Property. 
 | 
static <T> LeSpecification<T> | 
le(Property<T> property,
  T value)
Create a new LESS OR EQUALS specification for a Property. 
 | 
static <T> LeSpecification<T> | 
le(Property<T> property,
  Variable variable)
Create a new LESS OR EQUALS specification for a Property using a named Variable. 
 | 
static <T> LtSpecification<T> | 
lt(Property<T> property,
  T value)
Create a new LESSER THAN specification for a Property. 
 | 
static <T> LtSpecification<T> | 
lt(Property<T> property,
  Variable variable)
Create a new LESSER THAN specification for a Property using a named Variable. 
 | 
static <T> ManyAssociationFunction<T> | 
manyAssociation(ManyAssociation<T> association)
Create a new Query Template ManyAssociationFunction. 
 | 
static MatchesSpecification | 
matches(Property<String> property,
       String regexp)
Create a new REGULAR EXPRESSION specification for a Property. 
 | 
static MatchesSpecification | 
matches(Property<String> property,
       Variable variable)
Create a new REGULAR EXPRESSION specification for a Property using a named Variable. 
 | 
static <T> NamedAssociationFunction<T> | 
namedAssociation(NamedAssociation<T> association)
Create a new Query Template NamedAssociationFunction. 
 | 
static <T> NeSpecification<T> | 
ne(Property<T> property,
  T value)
Create a new NOT EQUALS specification for a Property. 
 | 
static <T> NeSpecification<T> | 
ne(Property<T> property,
  Variable variable)
Create a new NOT EQUALS specification for a Property using a named Variable. 
 | 
static NotSpecification | 
not(Specification<Composite> operand)
Create a new NOT specification. 
 | 
static <T> T | 
oneOf(ManyAssociation<T> association)  | 
static <T> T | 
oneOf(NamedAssociation<T> association)  | 
static OrSpecification | 
or(Specification<Composite>... specs)
Create a new OR specification. 
 | 
static <T> OrderBy | 
orderBy(Property<T> property)
Create a new Query ascending order segment for a Property. 
 | 
static <T> OrderBy | 
orderBy(Property<T> property,
       OrderBy.Order order)
Create a new Query ordering segment for a Property. 
 | 
static <T> Property<T> | 
property(Class<?> mixinClass,
        String fieldName)
Create a new Query Property instance. 
 | 
static <T> PropertyFunction<T> | 
property(Property<T> property)
Create a new Query Template PropertyFunction. 
 | 
static <T> T | 
templateFor(Class<T> clazz)
Create a Query Template using the given type. 
 | 
static <T> T | 
templateFor(Class<T> mixinType,
           Association<?> association)
Create a Query Template using the given mixin class and association. 
 | 
static Variable | 
variable(String name)
Create a new Query Variable. 
 | 
public static <T> T templateFor(Class<T> clazz)
T - the type of the templateclazz - a class declaring the type of the templatepublic static <T> T templateFor(Class<T> mixinType, Association<?> association)
T - the type of the templatemixinType - a class declaring the type of the templateassociation - an associationpublic static <T> T oneOf(ManyAssociation<T> association)
public static <T> T oneOf(NamedAssociation<T> association)
public static Variable variable(String name)
name - a name for the Variablepublic static <T> PropertyFunction<T> property(Property<T> property)
T - type of the Propertyproperty - a Propertypublic static <T> Property<T> property(Class<?> mixinClass, String fieldName)
T - type of the PropertymixinClass - mixin of the PropertyfieldName - name of the Property fieldpublic static <T> AssociationFunction<T> association(Association<T> association)
T - type of the Associationassociation - an Associationpublic static <T> ManyAssociationFunction<T> manyAssociation(ManyAssociation<T> association)
T - type of the ManyAssociationassociation - a ManyAssociationpublic static <T> NamedAssociationFunction<T> namedAssociation(NamedAssociation<T> association)
T - type of the NamedAssociationassociation - a NamedAssociation@SafeVarargs public static AndSpecification and(Specification<Composite> left, Specification<Composite> right, Specification<Composite>... optionalRight)
left - first operandright - second operandoptionalRight - optional operands@SafeVarargs public static OrSpecification or(Specification<Composite>... specs)
specs - operandspublic static NotSpecification not(Specification<Composite> operand)
operand - specification to be negatedpublic static <T> EqSpecification<T> eq(Property<T> property, T value)
property - a Propertyvalue - its valuepublic static <T> EqSpecification<T> eq(Property<T> property, Variable variable)
property - a Propertyvariable - a Query Variablepublic static <T> EqSpecification<String> eq(Association<T> association, T value)
association - an Associationvalue - its valuepublic static <T> GeSpecification<T> ge(Property<T> property, T value)
property - a Propertyvalue - its valuepublic static <T> GeSpecification<T> ge(Property<T> property, Variable variable)
property - a Propertyvariable - a Query Variablepublic static <T> GtSpecification<T> gt(Property<T> property, T value)
property - a Propertyvalue - its valuepublic static <T> GtSpecification<T> gt(Property<T> property, Variable variable)
property - a Propertyvariable - a Query Variablepublic static <T> LeSpecification<T> le(Property<T> property, T value)
property - a Propertyvalue - its valuepublic static <T> LeSpecification<T> le(Property<T> property, Variable variable)
property - a Propertyvariable - a Query Variablepublic static <T> LtSpecification<T> lt(Property<T> property, T value)
property - a Propertyvalue - its valuepublic static <T> LtSpecification<T> lt(Property<T> property, Variable variable)
property - a Propertyvariable - a Query Variablepublic static <T> NeSpecification<T> ne(Property<T> property, T value)
property - a Propertyvalue - its valuepublic static <T> NeSpecification<T> ne(Property<T> property, Variable variable)
property - a Propertyvariable - a Query Variablepublic static MatchesSpecification matches(Property<String> property, String regexp)
property - a Propertyregexp - its valuepublic static MatchesSpecification matches(Property<String> property, Variable variable)
property - a Propertyvariable - a Query Variablepublic static <T> PropertyNotNullSpecification<T> isNotNull(Property<T> property)
property - a Propertypublic static <T> PropertyNullSpecification<T> isNull(Property<T> property)
property - a Propertypublic static <T> AssociationNotNullSpecification<T> isNotNull(Association<T> association)
association - an Associationpublic static <T> AssociationNullSpecification<T> isNull(Association<T> association)
association - an Associationpublic static <T> ContainsAllSpecification<T> containsAll(Property<? extends Collection<T>> collectionProperty, Iterable<T> values)
collectionProperty - a Collection Propertyvalues - its valuespublic static <T> ContainsAllSpecification<T> containsAllVariables(Property<? extends Collection<T>> collectionProperty, Iterable<Variable> variables)
collectionProperty - a Collection Propertyvariables - named Variablespublic static <T> ContainsSpecification<T> contains(Property<? extends Collection<T>> collectionProperty, T value)
collectionProperty - a Collection Propertyvalue - the valuepublic static <T> ContainsSpecification<T> contains(Property<? extends Collection<T>> collectionProperty, Variable variable)
collectionProperty - a Collection Propertyvariable - named Variablepublic static <T> ManyAssociationContainsSpecification<T> contains(ManyAssociation<T> manyAssoc, T value)
manyAssoc - a ManyAssociationvalue - the valuepublic static <T> NamedAssociationContainsSpecification<T> contains(NamedAssociation<T> namedAssoc, T value)
namedAssoc - a NamedAssociationvalue - the valuepublic static <T> NamedAssociationContainsNameSpecification<T> containsName(NamedAssociation<T> namedAssoc, String name)
namedAssoc - a NamedAssociationname - the namepublic static <T> OrderBy orderBy(Property<T> property)
T - type of the Propertyproperty - a Propertypublic static <T> OrderBy orderBy(Property<T> property, OrderBy.Order order)
T - type of the Propertyproperty - a Propertyorder - ascending or descending