Thanks for your reply!
The thing is that the SQL works, but the hibernate criteria doesn't!
The reason it's because, when adding the category restriction, this will restrict the cats and not only the pedigree class.
I believe that we should first do a subquery with its restriction, but the problem its how to connect a new criteria with a detached criteria.
I think that there should be a way to do a join between two criterias giving the path association, that in this case would be:
Code:
on c.Id = p.catId
Maybe this feature it's not yet implemented!
Does any one know something about this?