- Type Parameters:
R- the root query bean typeT- the type of the scalar property
- All Implemented Interfaces:
io.ebean.Query.Property<T>
- Direct Known Subclasses:
PBaseDate,PBaseNumber,PBaseString,PBaseTime,PScalarComparable,PString
-
Field Summary
Fields inherited from class io.ebean.typequery.TQProperty
_name, _root -
Constructor Summary
ConstructorsConstructorDescriptionPBaseComparable(String name, R root) Construct with a property name and root instance.PBaseComparable(String name, R root, String prefix) Construct with additional path prefix. -
Method Summary
Modifier and TypeMethodDescriptionfinal RBetween lower and upper values.final RbetweenProperties(io.ebean.Query.Property<T> highProperty, T value) Between - value between this property and another propertyfinal RGreater than or Equal to other property.final Rge(io.ebean.Query<?> subQuery) Property is Greater Than or Equal To the result of a sub-query.final RGreater than or Equal to.final RgeIfPresent(@Nullable T value) Is greater than or equal to if value is non-null and otherwise no expression is added to the query.final RGreater than or Equal to OR Null.final RgeSubQuery(String sqlSubQuery, Object... bindValues) Greater Than or Equal To a raw SQL SubQuery.final RgreaterOrEqualTo(T value) Greater than or Equal to.final RgreaterThan(T value) Greater than.final RgreaterThanOrNull(T value) Greater than or Null.final RGreater than other property.final Rgt(io.ebean.Query<?> subQuery) Property is Greater Than the result of a sub-query.final RGreater than.final RgtIfPresent(@Nullable T value) Is greater than if value is non-null and otherwise no expression is added to the query.final RGreater than OR Null.final RgtSubQuery(String sqlSubQuery, Object... bindValues) Greater Than a raw SQL SubQuery.final RGreater or equal to lower value and strictly less than upper value.final RinRangeWith(io.ebean.Query.Property<T> lowProperty, io.ebean.Query.Property<T> highProperty) A Property is in Range between 2 other properties.final RinRangeWith(io.ebean.Query.Property<T> highProperty, T value) Value in Range between 2 properties.final RLess than or Equal to other property.final Rle(io.ebean.Query<?> subQuery) Property is Less Than or Equal To the result of a sub-query.final RLess than or Equal to.final RleIfPresent(@Nullable T value) Is less than or equal to if value is non-null and otherwise no expression is added to the query.final RLess than or Equal to.final RlessOrEqualTo(T value) Less than or Equal to.final RLess than.final RlessThanOrNull(T value) Less than or Null.final RleSubQuery(String sqlSubQuery, Object... bindValues) Less Than or Equal To a raw SQL SubQuery.final RLess than other property.final Rlt(io.ebean.Query<?> subQuery) Property is Less Than the result of a sub-query.final RLess than.final RltIfPresent(@Nullable T value) Is less than if value is non-null and otherwise no expression is added to the query.final RLess than OR Null.final RltSubQuery(String sqlSubQuery, Object... bindValues) Less Than a raw SQL SubQuery.Methods inherited from class io.ebean.typequery.PBaseValueEqual
asMapKey, eq, eq, eq, eqIfPresent, eqOrNull, eqSubQuery, equalTo, equalToOrNull, in, in, in, inOrEmpty, inSubQuery, isIn, isIn, isIn, ne, ne, ne, neSubQuery, notEqualTo, notIn, notIn, notIn, notInSubQueryMethods inherited from class io.ebean.typequery.TQPropertyBase
asc, descMethods inherited from class io.ebean.typequery.TQProperty
expr, isNotNull, isNull, propertyName, toString
-
Constructor Details
-
PBaseComparable
Construct with a property name and root instance.- Parameters:
name- property nameroot- the root query bean instance
-
PBaseComparable
Construct with additional path prefix.
-
-
Method Details
-
gt
Greater than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
gt
Greater than other property.Note that the other property must have the same common "Base type" (String, Number, Temporal, Boolean or Object).
- Parameters:
other- the other property to compare- Returns:
- the root query bean instance
-
gtOrNull
Greater than OR Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
gtIfPresent
Is greater than if value is non-null and otherwise no expression is added to the query.That is, only add the GREATER THAN predicate if the value is not null.
This is effectively a helper method that allows a query to be built in fluid style where some predicates are effectively optional. We can use
gtIfPresent()rather than having a separate if block.- Parameters:
value- the value which can be null- Returns:
- the root query bean instance
-
ge
Greater than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
ge
Greater than or Equal to other property.- Parameters:
other- the other property to compare- Returns:
- the root query bean instance
-
geOrNull
Greater than or Equal to OR Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
geIfPresent
Is greater than or equal to if value is non-null and otherwise no expression is added to the query.That is, only add the GREATER THAN OR EQUAL TO predicate if the value is not null.
This is effectively a helper method that allows a query to be built in fluid style where some predicates are effectively optional. We can use
geIfPresent()rather than having a separate if block.- Parameters:
value- the value which can be null- Returns:
- the root query bean instance
-
lt
Less than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
lt
Less than other property.- Parameters:
other- the other property to compare- Returns:
- the root query bean instance
-
ltOrNull
Less than OR Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
ltIfPresent
Is less than if value is non-null and otherwise no expression is added to the query.That is, only add the LESS THAN predicate if the value is not null.
This is effectively a helper method that allows a query to be built in fluid style where some predicates are effectively optional. We can use
ltIfPresent()rather than having a separate if block.- Parameters:
value- the value which can be null- Returns:
- the root query bean instance
-
le
Less than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
le
Less than or Equal to other property.- Parameters:
other- the other property to compare- Returns:
- the root query bean instance
-
leOrNull
Less than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
leIfPresent
Is less than or equal to if value is non-null and otherwise no expression is added to the query.That is, only add the LESS THAN OR EQUAL TO predicate if the value is not null.
This is effectively a helper method that allows a query to be built in fluid style where some predicates are effectively optional. We can use
leIfPresent()rather than having a separate if block.- Parameters:
value- the value which can be null- Returns:
- the root query bean instance
-
inRange
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
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
-
inRangeWith
public final R inRangeWith(io.ebean.Query.Property<T> lowProperty, io.ebean.Query.Property<T> highProperty) A Property is in Range between 2 other properties.var o = QOrder.alias(); new QOrder() .orderDate.inRangeWith(o.product.startDate, o.product.endDate) .findList(); // which equates to product.startDate <= orderDate and (product.endDate > orderDate or product.endDate is null)This is a convenience expression combining a number of simple expressions.
-
between
Between lower and upper values.- Parameters:
lower- the lower bind valueupper- the upper bind value- Returns:
- the root query bean instance
-
betweenProperties
Between - value between this property and another property -
greaterThan
Greater than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
greaterThanOrNull
Greater than or Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
greaterOrEqualTo
Greater than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
lessThan
Less than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
lessThanOrNull
Less than or Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
lessOrEqualTo
Less than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
le
Property is Less Than or Equal To the result of a sub-query.- Parameters:
subQuery- value provided by a subQuery- Returns:
- the root query bean instance
-
lt
Property is Less Than the result of a sub-query.- Parameters:
subQuery- value provided by a subQuery- Returns:
- the root query bean instance
-
ge
Property is Greater Than or Equal To the result of a sub-query.- Parameters:
subQuery- value provided by a subQuery- Returns:
- the root query bean instance
-
gt
Property is Greater Than the result of a sub-query.- Parameters:
subQuery- value provided by a subQuery- Returns:
- the root query bean instance
-
leSubQuery
Less Than or Equal To a raw SQL SubQuery.- Parameters:
sqlSubQuery- The SQL SubQuerybindValues- Optional bind values if the SubQuery uses?bind values.
-
ltSubQuery
Less Than a raw SQL SubQuery.- Parameters:
sqlSubQuery- The SQL SubQuerybindValues- Optional bind values if the SubQuery uses?bind values.
-
geSubQuery
Greater Than or Equal To a raw SQL SubQuery.- Parameters:
sqlSubQuery- The SQL SubQuerybindValues- Optional bind values if the SubQuery uses?bind values.
-
gtSubQuery
Greater Than a raw SQL SubQuery.- Parameters:
sqlSubQuery- The SQL SubQuerybindValues- Optional bind values if the SubQuery uses?bind values.
-