| Jens Schauder Well, Hibernate used to work like that even before JPA 1.0. Now, changing from INNER to LEFT OUTER will complicate most implicit join queries since the underlying SQL must make sure that no JOINED column is referenced in the WHERE clause other than joined_table.column IS NULL OR joined_table.column = ?, otherwise, if you do a LEFT JOIN and the WHERE clause does something like joined_table.column = ?, the end result is equivalent to an INNER JOIN. But that's not all. Selecting an entity as a DTO projection is also something that Hibernate treats in a very specific manner, as explained by Steve. In 6.0, we might offer a property so that, instead of the entity identifier, the entity itself could be passed in the DTO projection. As for the implicit join, unless the JPA spec will ever demand that the provider must use LEFT JOIN, Hibernate will most likely use INNER JOIN, as it has been doing for the past 17 years. |