girirx wrote:
Found one way to do it, I am sure there is another way.
When I load the record by id by doing the following and then calling update, the generated sql is what I am looking for.
x12 = (X12Transaction) session.load(X12Transaction.class, new Long(_id));
Then update call results in:
Hibernate: update TRANSACTION set X12OUT=? where TRXID=?
The load by id, does that makes a select call?
It might if the an object with that identity has not already been loaded, or is not in the cache.
girirx wrote:
In that case is there a way to do the column update only without the overhead of the select sql?
When Hibernate loads an object, it must load all of it's properties. Otherwise, the object would be left in a strange state.
The new UPDATE command (planned for Hibernate3) will be able to update a single property of an object, but of course this kind of change will not be reflected in the objects in the current session for the very same reason.