-->
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: Insert data into table which have no primary key.
PostPosted: Thu May 15, 2008 8:56 am 
Newbie

Joined: Thu May 15, 2008 6:03 am
Posts: 3
Hi,
I want to insert data into table which have two fileds
1.typeid
2.privilegeid

none oof the field is pimary, i have read that in order to insert data in hibernate using query you must need <id> in your xml file, but i hope there must be some way through which one cud do that,if anybody know that please help.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 15, 2008 4:56 pm 
Newbie

Joined: Wed May 14, 2008 3:45 pm
Posts: 8
your table must have some business key. you can assign that key as id in the xml mapping or annotation. In your case it could be typeid or privilege id or combination of both. If it is combination then you need to use composite-id

Hibernate doesnot require explicit primary key declaration in the database table. It only requires that the key must be logically unique in that table


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.