Hi all,
I'm trying to create a query with Criteria API where I call multiple times createCriteria in the same collection property.
What I wanted to do is many inner joins in the same table but when hibernate send the sql query, it only does one inner join.
sql generated:
Code:
select this.iCodigo as iCodigo1_, this.sAssunto as sAssunto1_,
from PARENT this inner join CHILD i1 on this.iCodigo=i1.iProcesso where lower(i0.sNome) like ? and lower(i1.sNome) like ?
What I wanted:
Code:
select this.iCodigo as iCodigo1_, this.sAssunto as sAssunto1_,
from PARENT this inner join CHILD i1 on this.iCodigo=i1.iProcesso inner join CHILD i0 where lower(i0.sNome) like ? and lower(i1.sNome) like ?
Note that where clause is being correcly generated. But there is only one inner join.
Am I missing something?
What I want is to get all parents which have childs in commons. This commonality is given by the filed sNome of CHILD.
Thanks in advance.