title: Hibernate criteriaQuery createAlias equivalent
body: <p>I am looking at upgrading my hibernate to use JPA criteriaQuery :-( and need to find a way to implement an alias in JPA eg:</p>
  
  <pre><code>@Entity
  public class MyClass {
  ....
  @ManyToOne(..)
  public MyDetail getMyDetail() { 
  return myDetail;  
  }
  }
  
  Criteria criteria = session.createCriteria(MyClass.class);
  ....
  criteria.createAlias("myDetail", "md");
  criteria.add(Restrictions.eq("md.active", true));
  </code></pre>
  
  <p>I have been through the hibernate docs but they seem to have only covered trivial examples and glossed over hibernate specific functionality.</p>
  
  <p>Cheers Greg</p>