You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a class Person and two classes (Employee and Manager) that extends Person. I'm using hibernate JOINED inheritance strategy.
I also have a class Work that has an attribute person of type Person.
SELECT*FROM
Work
LEFT JOIN Person ONWork.personId=Person.personIdINNER JOIN Employee ONPerson.personId=Employee.personIdINNER JOIN Manager ONPerson.personId=Manager.personId
The problem is that my query is getting no results because of the INNER JOIN clauses.
The join between the parent table Person and the child tables (Employee and Manager) should have been done with LEFT JOIN instead of INNER JOIN.
I also tried adding the _super reference but it didn't work:
QueryDSL is not responsible for rendering SQL, your ORM is, probably Hibernate. This appears to be a Hibernate issue. Please validate on a recent Hibernate version.
Hello,
I have a class Person and two classes (Employee and Manager) that extends Person. I'm using hibernate JOINED inheritance strategy.
I also have a class Work that has an attribute person of type Person.
I'm having problems with the following query:
The generated SQL is something like:
The problem is that my query is getting no results because of the INNER JOIN clauses.
The join between the parent table Person and the child tables (Employee and Manager) should have been done with LEFT JOIN instead of INNER JOIN.
I also tried adding the _super reference but it didn't work:
How can I do this kind of query involving LEFT JOIN between parent and child tables?
The text was updated successfully, but these errors were encountered: