Hibernate version: 2.1.7
Name and version of the database you are using: SQL Server 2003
Hi there, i am a bit new working with hibernate, but i think i managed the basics. Now, im working in an old application using Hibernate 2.1.7, and for some time im looking to do something that i didnt managed to figure out how to do it yet... dont even know if it's possible. Anyway here it goes:
Normally when i what to update an object from the application, i load it into the session, change what i need and save it, no problem there, but i have a situation in which i want to change only one property for all the rows on one table.
At the moment my only solution is to load the entire collection of rows to the session, change the property and save it again, but seems to me a big waste of loading the collection, since i already know what and where i want to change... so what i want is a solution where i can change the property value or write it directly into the database, since i don't really need to load any information from it into the session.
I saw that Hibernate 3 supports HQL's updates which could probably solve my problem here, but is there anyway to do this in Hibernate 2.1.7? I read most of the documentation and i didnt see anything that could help me, or did i miss something?
Not including here the particular table or mapping since this is not a particular problem, but a general issue.
Thanks in advance.
|