#2873 - Query Beans: Support more TQProperty's as target value for inRangeWith()

This commit is contained in:
Rob Bygrave
2022-11-02 17:35:00 +13:00
parent 600aa10453
commit dd0ed8ea76
7 changed files with 88 additions and 0 deletions
@@ -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.
*