Hello!
i have a query:
SELECT t2.email
FROM myTable t1
JOIN myTable t2 ON t1.parentId = t2.id
WHERE t1.email = 'myemail'
how to implement it using AO?
(ao.find(MyClass.class, Query.select…etc))
i tried to make two aliases for same table and join it to itself, but it does not work
it looks like
String email = "myemail";
ao.find(
MyClass.class,
Query.select()
.alias(MyClass.class, "entity1")
.alias(MyClass.class, "entity2")
.join(MyClass.class, "entity1.parentId = entity2.id")
.where("EMAIL = ?", email));