0

I got a code in my bean like this:

Root<Application> root = query.from(Application.class);
Fetch<xxx, yyy> fetch = root.fetch(xxx.yyy, JoinType.LEFT);
fetch.fetch(yyy_.location, JoinType.LEFT);
fetch.fetch(yyy_.project, JoinType.LEFT);
root.fetch(xxx_.owner);

I need to fetch records zzz from other table, but there is no link between them in my application. For some records XXX are created ZZZ entrys with same ID number. I want to get them here for xxx. Is it possible?

Lukas Novicky
  • 921
  • 1
  • 19
  • 44

1 Answers1

1

Either add a relationship between the two or create a CriteriaQuery that will be translated to an SQL Cross Join and then add the condition XXX.zzz_id=ZZZ.id.

V G
  • 18,822
  • 6
  • 51
  • 89