mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2873 - Query Beans: Support more TQProperty's as target value for inRangeWith()
This commit is contained in:
@@ -200,6 +200,29 @@ public class PBaseCompareable<R, T> extends PBaseValueEqual<R, T> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Property is in Range between 2 other properties.
|
||||
*
|
||||
* <pre>{@code
|
||||
* 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)
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* <p>
|
||||
* This is a convenience expression combining a number of simple expressions.
|
||||
*/
|
||||
public final R inRangeWith(TQProperty<?> lowProperty, TQProperty<?> highProperty) {
|
||||
expr().inRangeWithProperties(_name, lowProperty.propertyName(), highProperty.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Between lower and upper values.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user