mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
Add test
This commit is contained in:
parent
175b2668ba
commit
598a7dae6e
@ -23,6 +23,7 @@ import com.querydsl.core.types.Expression;
|
||||
import com.querydsl.core.types.ExpressionUtils;
|
||||
import com.querydsl.core.types.Predicate;
|
||||
import com.querydsl.jpa.domain.QCat;
|
||||
import com.querydsl.jpa.domain.QCompany;
|
||||
import com.querydsl.jpa.domain.QDomesticCat;
|
||||
import com.querydsl.jpa.domain.QEmployee;
|
||||
|
||||
@ -41,6 +42,16 @@ public class JPACollectionAnyVisitorTest {
|
||||
assertEquals("cat_kittens_0.name", serialize(cat.kittens.any().name));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nested_any_booleanOperation() {
|
||||
QCompany company = QCompany.company;
|
||||
Predicate predicate = company.departments.any().employees.any().firstName.eq("Bob");
|
||||
assertEquals("exists (select 1\n" +
|
||||
"from company.departments as company_departments_0\n" +
|
||||
" inner join company_departments_0.employees as company_departments_0_employees_1\n" +
|
||||
"where company_departments_0_employees_1.firstName = ?1)", serialize(predicate));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void simple_booleanOperation() {
|
||||
Predicate predicate = cat.kittens.any().name.eq("Ruth123");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user