No We cannot achieve this using hibernate 3.0, may be hibernate team may consider these kind of expections future versions
vin wrote:
We have an app in which we need to lock a set of rows in the database and then perform a look up. I'm aware of using an update sql statement to do this but I was looking for an object oriented way of performing the same and like if I need to do something like
update <table_name> set lockId=2 where ownerQId=<name>
how do I express this in an object oriented fashion using Hibernate ?
I tried to use the criteria API to to replace the where clause but looks like the Query interface does not take any criteria object, so there is no way of doing something like
session.createQuery("update <table_name> set lockId=2).add(Expression.eq("ownerQId", <name>))
Did anyone come across something anything similar to this before ? can you share your thoughts ? Appreciate all the responses.