title: Could not resolve property Hibernate
body: <p>I have 2 entities whose extracts are like these:</p>
  
  <pre><code>public class Visita {
      @ManyToOne(fetch=FetchType.LAZY)
      @JoinColumn(name="pdv_uid")
      private PuntoDeVenta pdv;
  }
  
  public class PuntoDeVenta {
      private Integer idclient;
  
      private String zona;
  
      @ManyToOne
      @JoinColumn(name="pdv_categoria_uid", nullable=true)
      private PuntoDeVentaCategoria categoria;
  }
  
  public class PuntoDeVentaCategoria {
      private String descripcion;
  }
  </code></pre>
  
  <p>I try to do restrictions with the differents fields and some of them work, some of them don't.</p>
  
  <p>With this root criteria:</p>
  
  <pre><code>Criteria criteria =   sessionFactory.getCurrentSession().createCriteria(Visita.class).createAlias("pdv", "pdv");
  </code></pre>
  
  <p>I try to make restrictions with the differents fields of "PuntoDeVenta" and "PuntoDeVentaCategoria" (with and without the createAlias) and I get the exception "could not resolve property", for example:</p>
  
  <pre><code>Criteria criteria =   sessionFactory.getCurrentSession().createCriteria(Visita.class).createAlias("pdv", "pdv").add(Restrictions.eq("pdv.categoria.descripcion", "example"));
  </code></pre>
  
  <p>I've researching and I didn't found anything for my case.</p>
  
  <p>Thank you in advance</p>