title: hibernate: left outer join with Criteria API, is possible?
body: <p>I'm new on Hibernate so excuse me for banality but I can't find any answer related to my problem (i tried to search on docs &amp; on SO).</p>
  
  <p>If possible, I would create a left outer join from two tables (<code>t0</code> and <code>t1</code>) without using HQL; in my case I'd like to use only the Criteria API.</p>
  
  <pre><code>t0 { id, fieldA, fieldB }
  
  t1 { id, fieldC, fieldD }
  </code></pre>
  
  <p>I don't know which fields will be used for the join, the user can decide it.</p>
  
  <p>I see that the Criteria API has some nice functions such as <code>createAlias</code> or <code>createCriteria</code> but if I use these methods, I can't run a join.</p>
  
  <p>Every table has a class (mapped with a specific <code>hbm.xml</code>) like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping default-access="field"&gt;
  
  &lt;class name="it.class.T0" table="t0"&gt;
      &lt;meta attribute="class-description"&gt;Table 0&lt;/meta&gt;
      &lt;!-- Unique id --&gt;
      &lt;id name="id" type="long" column="id"&gt;
          &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;!-- Natural key --&gt;
      &lt;natural-id mutable="true"&gt;
          &lt;property name="fieldA" type="string" column="fieldA" not-null="true" /&gt;
          &lt;property name="fieldB" type="string" column="fieldB" not-null="true" /&gt;
      &lt;/natural-id&gt;
      &lt;!-- Fields --&gt;
      &lt;property name="column1" type="long" column="columnd1" not-null="true" /&gt;
      &lt;property name="column2" type="string" column="column2" not-null="false" /&gt;
  &lt;/class&gt;
  
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>The entity class is like this:</p>
  
  <pre><code>public class T0 implements Serializable
  {
     private static final long serialVersionUID = -8123118569358735984L;
  
     public long               id;
  
     public String             fieldA;
     public String             fieldB;
     public long               column1;
     public String             column2;
  
     public T0()
     {
        super();
     }
  }
  </code></pre>
  
  <p>Is it possible to create a left outer join programmatically (with the Criteria API) without specifying in the <code>hbm.xml</code> (or in a specific HQL) which fields to use?</p>