0

I see in this guide that providing paths as part of the predicate can generate a join:

get("/users?address.country=Spain") generates:

select user0_.id as id1_1_, 
       user0_.name as name2_1_ 
from user user0_ 
      cross join address address1_ 
where user0_.id=address1_.user_id 
      and address1_.country='Spain'

In the example above though I see that the relationship is one-to-one.

My question is: is it possible to provide a path that goes from one-to-many in order to create an implicit outer join

e.g. in the above guide example would I be able to provide: /users?address.country=Spain if users had one-to-many relationship with address, and get back something like the following?:

user1-address1
user1-address2
user2-address3
user2-address4
Marinos An
  • 9,481
  • 6
  • 63
  • 96

1 Answers1

0

I just answered this question, sort of, at least in terms of joining. I don't know what you mean by "as part of a predicate". I encourage you to research and post what you have tried before asking questions poorly on SO.

JPA Criteria: QuerySyntaxException for left join on treat entity

K.Nicholas
  • 10,956
  • 4
  • 46
  • 66