Skip to content

Defining multiple from clauses in a single query

gert-wijns edited this page Sep 12, 2014 · 2 revisions

Call query.from(entityClass) multiple times to create a query with multiple from clause elements.

Can be used when manual join is required because no property path is available.

Person person = query.from(Person.class);
Town town = query.from(Town.class);

query.where(person.getTown().getId()).eq(town.getId());

=> "from Person hobj1, Town hobj2 where hobj1.town.id = hobj2.id"
Clone this wiki locally