-->
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.  [ 3 posts ] 
Author Message
 Post subject: mapping of tables with no primary key
PostPosted: Mon Feb 23, 2004 10:57 am 
Newbie

Joined: Thu Feb 12, 2004 10:10 am
Posts: 6
Hi all,
how do i describe in the mapping file a table with no primary key?
The element <id> inside the element <class> is mandatory, and i've tried everything, i guess...

Thanks,

Luca


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2004 10:58 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
A table with no primary key is broken, as most SQL databases allow duplicate rows. Your data is in danger, change it.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2004 10:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Usually there is a property or a set of properties which makes your record unique. Map it as an id or a composite id.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.