mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
commit
71cd469ef8
@ -42,7 +42,7 @@ class JPACollectionAnyVisitor extends CollectionAnyVisitor {
|
||||
Path<?> child = c.paths.get(i).getMetadata().getParent();
|
||||
EntityPath<Object> replacement = (EntityPath<Object>) c.replacements.get(i);
|
||||
if (c.paths.get(i).getType().isAnnotationPresent(Entity.class)) {
|
||||
query.from(Expressions.as(
|
||||
query.addJoin(i == 0 ? JoinType.DEFAULT : JoinType.INNERJOIN, Expressions.as(
|
||||
Expressions.listPath((Class) c.paths.get(i).getType(), SimplePath.class,
|
||||
child.getMetadata()), replacement));
|
||||
} else {
|
||||
|
||||
@ -289,6 +289,11 @@ public abstract class AbstractJPATest {
|
||||
assertEquals(1, query().from(cat).where(cat.kittens.any().name.eq("Ruth123")).fetchCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Any_Any() {
|
||||
assertEquals(1, query().from(cat).where(cat.kittens.any().kittens.any().name.eq("Ruth123")).fetchCount());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void ArrayProjection() {
|
||||
|
||||
@ -49,6 +49,15 @@ public class JPACollectionAnyVisitorTest {
|
||||
"where cat_kittens_0.name = ?1)", serialize(predicate));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Simple_BooleanOperation_LongPath() {
|
||||
Predicate predicate = cat.kittens.any().kittens.any().name.eq("Ruth123");
|
||||
assertEquals("exists (select 1\n" +
|
||||
"from cat.kittens as cat_kittens_0\n" +
|
||||
" inner join cat_kittens_0.kittens as cat_kittens_0_kittens_1\n" +
|
||||
"where cat_kittens_0_kittens_1.name = ?1)", serialize(predicate));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Simple_BooleanOperation_ElementCollection() {
|
||||
QEmployee employee = QEmployee.employee;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user