-->
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: dml-style update
PostPosted: Tue Oct 14, 2008 7:33 am 
Beginner
Beginner

Joined: Thu Jun 14, 2007 4:33 am
Posts: 39
hi,

im using hibernate 3.2.6.ga

atm im trying to do a dml-style update to multiple colums per record:
Code:
String update = "update permission set permissionFlag = :v1 , source = :dsd where person.costumer_number = :v3";
        Query q = this.getSession().createQuery(update);
        q.setInteger("v1", permissionPostFlag);
        q.setString("v3", costumerNumber);
        q.setParameter("dsd", dsd);
        q.executeUpdate();


doing this i get
Code:
org.hibernate.exception.SQLGrammarException: could not execute update query
....
org.postgresql.util.PSQLException: ERROR: syntax error at or near ","


when i log my querystring it seams to be correct:
Code:
update uboot.dwh.objects.core.PermissionPost set permissionFlag = :v1 , source = :dsd where person.costumer_number = :v3


the created query looks like:
Code:
Hibernate: update dwh_test.PERMISSION_POST,  set PERMISSION_FLAG=?, SOURCE=? where COSTUMER_NUMBER=?


does hibernate support updating multiple columns at once? is this a known bug?


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.