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.  [ 2 posts ] 
Author Message
 Post subject: how to write "update Foo set column = value where condi
PostPosted: Tue Aug 31, 2004 5:36 pm 
Newbie

Joined: Tue Jul 27, 2004 1:17 pm
Posts: 12
Hibernate version:2.1

I want to update all rows matching a set of conditions. I tried using a Query statement but got the error "query must begin with select or from"

I know I _could_ do this by loading each matching object, updating the pojo and then calling pojo.update() but that feels very entity_beanish.

Can anyone tell me the hibernate way to do this? Thanks.

Brian Tarbox


Top
 Profile  
 
 Post subject: Re: how to write "update Foo set column = value where c
PostPosted: Wed Sep 01, 2004 10:59 am 
Newbie

Joined: Tue Jan 27, 2004 3:26 pm
Posts: 18
btarbox wrote:
I want to update all rows matching a set of conditions. I tried using a Query statement but got the error "query must begin with select or from"

I know I _could_ do this by loading each matching object, updating the pojo and then calling pojo.update() but that feels very entity_beanish.

Can anyone tell me the hibernate way to do this? Thanks.


Use JBDC connection or wait for HB 3.1 :).

Artur


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

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.