I have following POJO`s: - Company
Node (nodeID, company)
User (userID, node)
I want to create where clause(via Criteria) which will return to me every user for given company. Something like ...
Criteria criteria = session.createCriteria(User.class)
criteria.add(Restrinctions.eq("node.company", someCompanyObject);
But this is not working, so is it possible to do this with criteria class or should use HQL/SQL?
Thanks in advance!