title: Why LEFT OUTER Join is needed for one-to-one bidirectional association
body: <p>I am following Hibernate documentation for <a href="http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch08.html#assoc-bidirectional-121" rel="nofollow">bidirectional one-to-one relationship</a> and created one-to-one mapping between <code>Person</code> and <code>Address</code> entities.</p>
  
  <p>The mapping is like the one given in document:</p>
  
  <pre><code>&lt;class name="Person"&gt;
      &lt;id name="id" column="personId"&gt;
          &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;many-to-one name="address" 
          column="addressId" 
          unique="true"
          not-null="true"/&gt;
  &lt;/class&gt;
  
  &lt;class name="Address"&gt;
      &lt;id name="id" column="addressId"&gt;
          &lt;generator class="native"/&gt;
      &lt;/id&gt;
     &lt;one-to-one name="person" 
          property-ref="address"/&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p>Now I created s smll program to fetch the <code>Person</code> and the corresponding <code>Address</code> like this:</p>
  
  <pre><code>    List&lt;Person&gt; persons = session.createQuery("from Person where id=2").list();
      for (Person person : persons) {
          System.out.println(person);
          System.out.println(person.getAddress());
          System.out.println(person.getAddress().getPerson());
      }
  </code></pre>
  
  <p>For the line <code>person.getAddress()</code>, hibernate issues a <code>LEFT OUTER JOIN</code> query as:</p>
  
  <pre><code>select
          address0_.addressId as addressId1_0_0_,
          person1_.personId as personId1_1_1_,
          person1_.addressId as addressId3_1_1_ 
      from
          ADDRESS address0_ 
      left outer join
          PERSON person1_ 
              on address0_.addressId=person1_.addressId 
      where
          address0_.addressId=?
  </code></pre>
  
  <p>If a <code>inner join</code> is sufficient in this case then why hibernate uses <code>left outer join</code>? Please clarify.</p>