title: Hibernate default joining for nullable many-to-one
body: <p>I have a hibernate mapping like this in a ProductDfn class</p>
  
  <pre><code>@ManyToOne( fetch = FetchType.LAZY, optional = true )
  @JoinColumn( name = "productTypeFk", nullable = true )
  public ProductType getProductType()
  {
      return productType;
  }
  </code></pre>
  
  <p>Note that the relationship is defined as optional (and the column is nullable).</p>
  
  <p>When doing HQL something like this</p>
  
  <pre><code>select p.name as col1, p.productType.name as col2 from ProductDfn p
  </code></pre>
  
  <p>An inner join is used to join ProductDfn to ProductType as hibernate generates the explicit SQL join from the implicit join in the select clause.</p>
  
  <p>However when doing the above when productType is null (in the DB) no row is returned because of the inner join.  For this relationship I would like to have hibernate default to doing an outer join (because the relationship is optional) so I would get a "null" back for col2 rather than no row at all.</p>
  
  <p>Does anyone know if this is possible?</p>
  
  <p>Thanks.</p>