Class PBaseComparable<R,T>
- 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 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 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 TQPropertyBase
asc, descMethods inherited from class TQProperty
expr, isNotNull, isNull, propertyName, toString
-
Constructor Details
-
PBaseComparable
-
PBaseComparable
-
-
Method Details
-
gt
-
gt
-
gtOrNull
-
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
-
ge
-
geOrNull
-
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
-
lt
-
ltOrNull
-
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
-
le
-
leOrNull
-
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
-
betweenProperties
-
greaterThan
-
greaterThanOrNull
-
greaterOrEqualTo
-
lessThan
-
lessThanOrNull
-
lessOrEqualTo
-
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
-
ltSubQuery
-
geSubQuery
-
gtSubQuery
-