title: Simple hql named query that uses a inner join
body: <p>I want to do something like this in my domain/entity object :</p>
  
  <pre><code>@Entity
  @NamedQueries({
  @NamedQuery(name="favouriteCats", query="from Cat c inner join on UserCat uc where uc.isFavourtie = true and uc.user = :user")
  })
  public final class Cat extends BaseTable
  </code></pre>
  
  <p>So that in my service layer I can do this :</p>
  
  <pre><code>Query query = session.getNamedQuery("favouriteCats")
  query.setParameter(0, MyUser);
  return query.list();
  </code></pre>
  
  <p>However, my syntax in HQL is incorrect - and aftern ten minutes looking at official docs I have decided to give up and ask here ... ?
  My usercat table is joined like so :</p>
  
  <pre><code>@ManyToOne(cascade = CascadeType.MERGE)
  @JoinColumn(name="cat_fk", insertable=false, updatable=false)
  private cat
  </code></pre>
  
  <p><strong>The sql is this, it works fine at my db command prompt:</strong></p>
  
  <pre><code>select c.* 
  from cat as c inner join usercat as uc on c.id = uc.cat_fk 
  and uc.isFavourite = 1 //bit field
  and uc.user_fk = 74 //just user id
  </code></pre>
  
  <p>Is it just me or is the hibernate documentation rather painful, and do you find yourself often wondering whether it would be quicker just to write normal jdbc prepared statements to populate your pojos/domain objects/dto's... ?</p>