I have a hibernate mapping like this in a ProductDfn class
@ManyToOne( fetch = FetchType.LAZY, optional = true )
@JoinColumn( name = \"productTypeFk\", nulla
An inner join is used because you've explicitly listed p.productType.name
in your select clause. This wouldn't have happened were you just to select ProductDfn
since your fetch is set to LAZY
.
If you only need to retrieve those two properties you'll have to explicitly specify an outer join in your query:
select p.name as col1, ptype.name as col2
from ProductDfn p
left join fetch p.productType ptype