I have the following context:
class Entidade1
private Long id;
private int commentId;
private int userId;
class Entidade2
private Long id;
private String descricao;
- I have the following criteria
Criteria criteria = persistence.createCriteria(Entidade2.class);
criteria.add((Restrictions.eq("descricao", "Teste")));
I need to do the following. return all Entities2 that satisfy the following filter
Entidade1.commentId != Entidade2.id
and Entidade1.userId = 1
Today I'm doing two for
to solve the problem but not this performative.