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:
@@ -665,6 +665,22 @@ public class QCustomerTest {
|
||||
.findList();
|
||||
}
|
||||
|
||||
@Test
|
||||
void query_inRangeWithOtherProperties() {
|
||||
var c = QCustomer.alias();
|
||||
|
||||
Query<Customer> query = new QCustomer()
|
||||
.select(c.id)
|
||||
.name.inRangeWith(c.contacts.firstName, c.contacts.lastName)
|
||||
.query();
|
||||
|
||||
// select distinct t0.id from be_customer t0
|
||||
// left join be_contact t1 on t1.customer_id = t0.id
|
||||
// where t1.first_name <= t0.name and (t0.name < t1.last_name or t1.last_name is null)
|
||||
query.findList();
|
||||
assertThat(query.getGeneratedSql()).contains(" where t1.first_name <= t0.name and (t0.name < t1.last_name or t1.last_name is null)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void query_exists() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user