- java.lang.Object
-
- io.ebean.typequery.TQProperty<R>
-
- io.ebean.typequery.TQPropertyBase<R>
-
- io.ebean.typequery.PBaseValueEqual<R,T>
-
- io.ebean.typequery.PBaseCompareable<R,T>
-
- Type Parameters:
R- the root query bean typeT- the type of the scalar property
- Direct Known Subclasses:
PBaseDate,PBaseNumber,PBaseString,PScalarComparable,PString,PZonedDateTime
public class PBaseCompareable<R,T> extends PBaseValueEqual<R,T>
Base property for all comparable types.
-
-
Field Summary
-
Fields inherited from class io.ebean.typequery.TQProperty
_name, _root
-
-
Constructor Summary
Constructors Constructor Description PBaseCompareable(String name, R root)Construct with a property name and root instance.PBaseCompareable(String name, R root, String prefix)Construct with additional path prefix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rbetween(T lower, T upper)Between lower and upper values.Rge(T value)Greater than or Equal to.RgeOrNull(T value)Greater than or Equal to OR Null.RgreaterOrEqualTo(T value)Greater than or Equal to.RgreaterThan(T value)Greater than.RgreaterThanOrNull(T value)Greater than or Null.Rgt(T value)Greater than.RgtOrNull(T value)Greater than OR Null.RinRange(T lower, T upper)Greater or equal to lower value and strictly less than upper value.RinRangeWith(TQProperty<R> highProperty, T value)Value in Range between 2 properties.Rle(T value)Less than or Equal to.RleOrNull(T value)Less than or Equal to.RlessOrEqualTo(T value)Less than or Equal to.RlessThan(T value)Less than.RlessThanOrNull(T value)Less than or Null.Rlt(T value)Less than.RltOrNull(T value)Less than OR Null.-
Methods inherited from class io.ebean.typequery.PBaseValueEqual
asMapKey, eq, eqOrNull, equalTo, equalToOrNull, in, in, in, inOrEmpty, isIn, isIn, isIn, ne, notEqualTo, notIn, notIn
-
Methods inherited from class io.ebean.typequery.TQPropertyBase
asc, desc
-
Methods inherited from class io.ebean.typequery.TQProperty
expr, isNotNull, isNull, propertyName, toString
-
-
-
-
Method Detail
-
gt
public final R gt(T value)
Greater than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
gtOrNull
public final R gtOrNull(T value)
Greater than OR Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
ge
public final R ge(T value)
Greater than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
geOrNull
public final R geOrNull(T value)
Greater than or Equal to OR Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
lt
public final R lt(T value)
Less than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
ltOrNull
public final R ltOrNull(T value)
Less than OR Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
le
public final R le(T value)
Less than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
leOrNull
public final R leOrNull(T value)
Less than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
inRange
public final R inRange(T lower, T upper)
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
public final R inRangeWith(TQProperty<R> highProperty, T value)
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
-
between
public final R between(T lower, T upper)
Between lower and upper values.- Parameters:
lower- the lower bind valueupper- the upper bind value- Returns:
- the root query bean instance
-
greaterThan
public final R greaterThan(T value)
Greater than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
greaterThanOrNull
public final R greaterThanOrNull(T value)
Greater than or Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
greaterOrEqualTo
public final R greaterOrEqualTo(T value)
Greater than or Equal to.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
lessThan
public final R lessThan(T value)
Less than.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
lessThanOrNull
public final R lessThanOrNull(T value)
Less than or Null.- Parameters:
value- the bind value- Returns:
- the root query bean instance
-
-