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: Update query for multiple columns
PostPosted: Mon Jan 21, 2008 6:08 am 
Newbie

Joined: Tue Feb 27, 2007 3:58 am
Posts: 5
Location: Netherlands
I have a small question, but I can't seem to find the answer;
I want to change two columns in one query, but I don't know the right syntax...
The columns are Float-values.

Code:
String hql = "update Location set longitude=NULL, latitude=NULL where longitude = '0' or latitude = '0'";
session.createQuery(hql).executeUpdate();
session.flush();
session.close();


There is no error-message, it says it updated a lot of rows, but nothing really changes in the database...


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.