title: Difference between createCriteria and createAlias
body: <p>I was reading hibernate criteria document here:</p>
  
  <p><a href="http://docs.jboss.org/hibernate/orm/3.6/javadocs/org/hibernate/Criteria.html" rel="nofollow">http://docs.jboss.org/hibernate/orm/3.6/javadocs/org/hibernate/Criteria.html</a></p>
  
  <p>I had used it many time and I am normally use <strong>createAlias()</strong> to join table, here they have provide two methods to make a join and fetch data from the tables, there are:</p>
  
  <pre><code> List cats = session.createCriteria(Cat.class)
       .createCriteria("kittens")
           .add( Restrictions.like("name", "Iz%") )
       .list();
  
   List cats = session.createCriteria(Cat.class)
       .createAlias("kittens", "kit")
       .add( Restrictions.like("kit.name", "Iz%") )
       .list();
  </code></pre>
  
  <p>So I am not able to distinguish difference between <code>.createCriteria("kittens")</code> and <code>createAlias("kittens", "kit")</code> or may be I am not getting what this code exactly do, can someone help me to clear my confusion. </p>