title: How to add aliases in my disjunction using hibernate?
body: <p>I'm writing a Criteria query using hibernate. I have a DTO object and I have to generate a query using its fields. Everyting seems fine when I create a disjunction like this:</p>
  
  <pre><code>Criteria c = s.createCriteria(Item.class);
          c.add(Restrictions.disjunction()
                  .add(Restrictions.like("buyer", dto.getUser()))
                  .add(Restrictions.like("rndEngineer", dto.getUser()))
                  .add(Restrictions.like("logistics", dto.getUser()))
                  .add(Restrictions.like("qaEngineer", dto.getUser()))
          );
  </code></pre>
  
  <p>But if I add an alias to my query to be able to do this:</p>
  
  <pre><code>Criteria c = s.createCriteria(Item.class);
          c.createAlias("wiEngineer", "we");
          c.add(Restrictions.disjunction()
                  .add(Restrictions.like("buyer", dto.getUser()))
                  .add(Restrictions.like("rndEngineer", dto.getUser()))
                  .add(Restrictions.like("logistics", dto.getUser()))
                  .add(Restrictions.like("qaEngineer", dto.getUser()))
                  .add(Restrictions.like("we.sid", dto.getUser()))
          );
  </code></pre>
  
  <p>the where clause is fine but my result set is missing some elements. I think that Hibernate inner joins we on my item. Can I make Hibernate left join my alias somehow? I googled on it but to no avail.</p>