-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Possible to update a single property in hibernate 2.1.7?
PostPosted: Fri Mar 02, 2007 12:58 pm 
Newbie

Joined: Fri Mar 02, 2007 12:40 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.