-->
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: Importance of primary key
PostPosted: Tue Sep 27, 2005 10:30 am 
Newbie

Joined: Fri Sep 16, 2005 12:10 pm
Posts: 3
Is it importtant that every table in the database have a primary key for which a persistent class mapping is desired? Can we have a database table that does not have a primary key and map a class to it without the <id> attribute?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 11:54 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
As far as I know the <id> attribute is mandatory. In other words, NHibernate like any other O/R mapper is an "object-relational" mapper. This means that you need a table with a primary key otherwise that table is not part of a relational database.

Regards,
Radu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 12:05 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
AFAIK, <id> is required, you don't have to map it to a property in your entity, but it must be mapped to a column in your database...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.