zlekonis
zlekonis

Reputation: 31

Hibernate 5 CriteriaBuilder query by id

Since Hibernate 5 no longer supports createCriteria, I cannot figure out how to replace the old session.createCriteria(className.class).add(Restrictions.idEq(id)).list(); idEq() part with CriteriaBuilder. CriteriaBuilder equal method works only if I have attribute name. What I need is query by identifier.

Any ideas?

Upvotes: 0

Views: 402

Answers (0)

Related Questions