0
While researching a little I realized that there are some ways to make a Join using criteria.
One of them is using an alias and the other using a root.
How to do the query below in Criteria using the 2 forms and which of the two would be the best (better in relation to performance)?
Select c.id from entidade c inner join entidade2 e where c.id=e.idC;
Does anyone know any site with a nice documentation regarding Criterias and Joins?
I know a way to do but returns the whole entity and that’s not quite how I want it because I just want the entity id.
Criteria c = session.createCriteria(Entidade.class, "C");
c.createAlias("C.entidades1", "e");
c.add(Restrictions.eq("c.id", "e.idC"));
c.list();