public final class QueryExpressions extends Object
Modifier and Type | Method and Description |
---|---|
static AndPredicate |
and(Predicate<Composite> left,
Predicate<Composite> right,
Predicate<Composite>... optionalRight)
Create a new AND specification.
|
static <T> AssociationFunction<T> |
association(Association<T> association)
Create a new Query Template AssociationFunction.
|
static <T> ManyAssociationContainsPredicate<T> |
contains(ManyAssociation<T> manyAssoc,
T value)
Create a new CONTAINS specification for a ManyAssociation.
|
static <T> NamedAssociationContainsPredicate<T> |
contains(NamedAssociation<T> namedAssoc,
T value)
Create a new CONTAINS specification for a NamedAssociation.
|
static <T> ContainsPredicate<T> |
contains(Property<? extends Collection<T>> collectionProperty,
T value)
Create a new CONTAINS specification for a Collection Property.
|
static <T> ContainsPredicate<T> |
contains(Property<? extends Collection<T>> collectionProperty,
Variable variable)
Create a new CONTAINS specification for a Collection Property using named Variables.
|
static <T> ContainsAllPredicate<T> |
containsAll(Property<? extends Collection<T>> collectionProperty,
Collection<T> values)
Create a new CONTAINS ALL specification for a Collection Property.
|
static <T> ContainsAllPredicate<T> |
containsAllVariables(Property<? extends Collection<T>> collectionProperty,
Collection<Variable> variables)
Create a new CONTAINS ALL specification for a Collection Property using named Variables.
|
static <T> NamedAssociationContainsNamePredicate<T> |
containsName(NamedAssociation<T> namedAssoc,
String name)
Create a new CONTAINS NAME specification for a NamedAssociation.
|
static <T> EqPredicate<Identity> |
eq(Association<T> association,
T value)
Create a new EQUALS specification for an Association.
|
static <T> EqPredicate<T> |
eq(Property<T> property,
T value)
Create a new EQUALS specification for a Property.
|
static <T> EqPredicate<T> |
eq(Property<T> property,
Variable variable)
Create a new EQUALS specification for a Property using a named Variable.
|
static <T> GePredicate<T> |
ge(Property<T> property,
T value)
Create a new GREATER OR EQUALS specification for a Property.
|
static <T> GePredicate<T> |
ge(Property<T> property,
Variable variable)
Create a new GREATER OR EQUALS specification for a Property using a named Variable.
|
static <T> GtPredicate<T> |
gt(Property<T> property,
T value)
Create a new GREATER THAN specification for a Property.
|
static <T> GtPredicate<T> |
gt(Property<T> property,
Variable variable)
Create a new GREATER THAN specification for a Property using a named Variable.
|
static <T> AssociationNotNullPredicate<T> |
isNotNull(Association<T> association)
Create a new NOT NULL specification for an Association.
|
static <T> PropertyNotNullPredicate<T> |
isNotNull(Property<T> property)
Create a new NOT NULL specification for a Property.
|
static <T> AssociationNullPredicate<T> |
isNull(Association<T> association)
Create a new NULL specification for an Association.
|
static <T> PropertyNullPredicate<T> |
isNull(Property<T> property)
Create a new NULL specification for a Property.
|
static <T> LePredicate<T> |
le(Property<T> property,
T value)
Create a new LESS OR EQUALS specification for a Property.
|
static <T> LePredicate<T> |
le(Property<T> property,
Variable variable)
Create a new LESS OR EQUALS specification for a Property using a named Variable.
|
static <T> LtPredicate<T> |
lt(Property<T> property,
T value)
Create a new LESSER THAN specification for a Property.
|
static <T> LtPredicate<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 MatchesPredicate |
matches(Property<String> property,
String regexp)
Create a new REGULAR EXPRESSION specification for a Property.
|
static MatchesPredicate |
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> NePredicate<T> |
ne(Property<T> property,
T value)
Create a new NOT EQUALS specification for a Property.
|
static <T> NePredicate<T> |
ne(Property<T> property,
Variable variable)
Create a new NOT EQUALS specification for a Property using a named Variable.
|
static Notpredicate |
not(Predicate<Composite> operand)
Create a new NOT specification.
|
static <T> T |
oneOf(ManyAssociation<T> association) |
static <T> T |
oneOf(NamedAssociation<T> association) |
static OrPredicate |
or(Predicate<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 AndPredicate and(Predicate<Composite> left, Predicate<Composite> right, Predicate<Composite>... optionalRight)
left
- first operandright
- second operandoptionalRight
- optional operands@SafeVarargs public static OrPredicate or(Predicate<Composite>... specs)
specs
- operandspublic static Notpredicate not(Predicate<Composite> operand)
operand
- specification to be negatedpublic static <T> EqPredicate<T> eq(Property<T> property, T value)
T
- Property typeproperty
- a Propertyvalue
- its valuepublic static <T> EqPredicate<T> eq(Property<T> property, Variable variable)
T
- Property typeproperty
- a Propertyvariable
- a Query Variablepublic static <T> EqPredicate<Identity> eq(Association<T> association, T value)
T
- Association typeassociation
- an Associationvalue
- its valuepublic static <T> GePredicate<T> ge(Property<T> property, T value)
T
- Property typeproperty
- a Propertyvalue
- its valuepublic static <T> GePredicate<T> ge(Property<T> property, Variable variable)
T
- Property typeproperty
- a Propertyvariable
- a Query Variablepublic static <T> GtPredicate<T> gt(Property<T> property, T value)
T
- Property typeproperty
- a Propertyvalue
- its valuepublic static <T> GtPredicate<T> gt(Property<T> property, Variable variable)
T
- Property typeproperty
- a Propertyvariable
- a Query Variablepublic static <T> LePredicate<T> le(Property<T> property, T value)
T
- Property typeproperty
- a Propertyvalue
- its valuepublic static <T> LePredicate<T> le(Property<T> property, Variable variable)
T
- Property typeproperty
- a Propertyvariable
- a Query Variablepublic static <T> LtPredicate<T> lt(Property<T> property, T value)
T
- Property typeproperty
- a Propertyvalue
- its valuepublic static <T> LtPredicate<T> lt(Property<T> property, Variable variable)
T
- Property typeproperty
- a Propertyvariable
- a Query Variablepublic static <T> NePredicate<T> ne(Property<T> property, T value)
T
- Property typeproperty
- a Propertyvalue
- its valuepublic static <T> NePredicate<T> ne(Property<T> property, Variable variable)
T
- Property typeproperty
- a Propertyvariable
- a Query Variablepublic static MatchesPredicate matches(Property<String> property, String regexp)
property
- a Propertyregexp
- its valuepublic static MatchesPredicate matches(Property<String> property, Variable variable)
property
- a Propertyvariable
- a Query Variablepublic static <T> PropertyNotNullPredicate<T> isNotNull(Property<T> property)
T
- Property typeproperty
- a Propertypublic static <T> PropertyNullPredicate<T> isNull(Property<T> property)
T
- Property typeproperty
- a Propertypublic static <T> AssociationNotNullPredicate<T> isNotNull(Association<T> association)
T
- Association typeassociation
- an Associationpublic static <T> AssociationNullPredicate<T> isNull(Association<T> association)
T
- Association typeassociation
- an Associationpublic static <T> ContainsAllPredicate<T> containsAll(Property<? extends Collection<T>> collectionProperty, Collection<T> values)
T
- Collection property typecollectionProperty
- a Collection Propertyvalues
- its valuespublic static <T> ContainsAllPredicate<T> containsAllVariables(Property<? extends Collection<T>> collectionProperty, Collection<Variable> variables)
T
- Collection property typecollectionProperty
- a Collection Propertyvariables
- named Variablespublic static <T> ContainsPredicate<T> contains(Property<? extends Collection<T>> collectionProperty, T value)
T
- Collection property typecollectionProperty
- a Collection Propertyvalue
- the valuepublic static <T> ContainsPredicate<T> contains(Property<? extends Collection<T>> collectionProperty, Variable variable)
T
- Collection property typecollectionProperty
- a Collection Propertyvariable
- named Variablepublic static <T> ManyAssociationContainsPredicate<T> contains(ManyAssociation<T> manyAssoc, T value)
T
- ManyAssociation typemanyAssoc
- a ManyAssociationvalue
- the valuepublic static <T> NamedAssociationContainsPredicate<T> contains(NamedAssociation<T> namedAssoc, T value)
T
- NamedAssociation typenamedAssoc
- a NamedAssociationvalue
- the valuepublic static <T> NamedAssociationContainsNamePredicate<T> containsName(NamedAssociation<T> namedAssoc, String name)
T
- NamedAssociation typenamedAssoc
- 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