-->
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 QL for merge incorrect for compound Id
PostPosted: Thu May 28, 2009 9:43 am 
Newbie

Joined: Tue Feb 03, 2009 7:26 pm
Posts: 10
I have a class, MiscData as below. Note that it got compound ids, siteId and dataType. Hibernate seem to generate
Code:
update MISC_DATA set DATA=?, SITE_ID=? where TYPE=?
for merge/update whereas it should have been more like
Code:
update MISC_DATA set DATA=? where SITE_ID=? and TYPE=?


Please help.

Code:
@Entity
@Table(name = "MISC_DATA")
public class MiscData implements Serializable {
   @Id
   @Column(name = "SITE_ID", updatable = false)
   private String siteId;

   @Id
   @Column(name = "TYPE", updatable = false)
   private String dataType;

   @Column(name = "DATA")
   private String data;
}


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.