jpql « Entity « JPA Q&A





1. LEFT JOIN ON() in JPQL    stackoverflow.com

I have two entities:

  • User: id:long, name:String
  • Player: id:long, owner:User, points:int
Now I want to select a User and his associated Player in one JPQL query. In SQL I'd do it like this:
SELECT u.*, ...

2. JPA join entity on the same entity    stackoverflow.com

I have a question about JPQL. I need to join entity on the same entity. Entity.child_id is mapped as a collection in JPA entity class, i.e. entity have a collection property ...