mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-16 21:01:10 +08:00
improved subquery tests
This commit is contained in:
parent
7926189207
commit
740dfd85d6
@ -27,13 +27,21 @@ public class JPQLCollectionAnyVisitorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Simple_Operation(){
|
||||
public void Simple_BooleanOperation(){
|
||||
Predicate predicate = cat.kittens.any().name.eq("Ruth123");
|
||||
assertEquals("exists (select 1\n" +
|
||||
"from Cat cat_kittens\n" +
|
||||
"where cat_kittens in elements(cat.kittens) and cat_kittens.name = :a1)", serialize(predicate));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Simple_StringOperation(){
|
||||
Predicate predicate = cat.kittens.any().name.substring(1).eq("uth123");
|
||||
assertEquals("exists (select 1\n" +
|
||||
"from Cat cat_kittens\n" +
|
||||
"where cat_kittens in elements(cat.kittens) and substring(cat_kittens.name,:a1+1) = :a2)", serialize(predicate));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void And_Operation(){
|
||||
// TODO : the subqueries should be merged
|
||||
|
||||
Loading…
Reference in New Issue
Block a user