I need to specify lock mode for hibernate. What I am doing:
session().createCriteria(clazz, "c")
.add(Restrictions.eq("c.a", false))
.add(Subqueries.propertyEq("c.b", subquery))
.setLockMode("pos", LockMode.PESSIMISTIC_READ);
But when I see provided query - hibernate still doesn't provide SELECT FOR UPDATE
How can I force hibernate to make SELECT FOR UPDATE
clause?
I see only case when it works is this:
session().get(clazz, id, LockOptions.UPGRADE);
But I need to use more complex query.