How to build Exists Expression with a sub expression on the child entity?

Ricardo Parada <[email protected]> Fri, 26 Sep 2025 12:31:00 -0400
Newsgroups gmane.comp.java.cayenne.user
Message-ID <[email protected]>
Hi all,

Another question I have is regarding EXISTS expressions.  I=E2=80=99m =
not sure if I=E2=80=99m using the API correctly, but I was thinking it =
would be something like this.  Using the entities from the Tutorial, =
let=E2=80=99s say I want to fetch the Artist=E2=80=99s that have a =
painting starting with the letter =E2=80=98G=E2=80=99:

Expression e =3D Artist.PAINTINGS.exists(Painting.NAME.like(=E2=80=9CG%=E2=
=80=9D));

But I=E2=80=99m getting a syntax error.=