-->
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: Table with no Primary Key vs Hibernate
PostPosted: Wed Oct 29, 2003 3:39 am 
Newbie

Joined: Tue Oct 28, 2003 3:48 am
Posts: 8
Location: LECOTAD
We have strong interest to work with hibernate in our new project.
But I am still confused about tables relationships with foreign key or without defined primary or unique key.

Can work hibernate with table, which don`t have any primary,unique key, only foreign key???
How its *.hbm.xml look like in this case?

We have problem when we try to use hibernate on customer`s database schema where a lot of tables does not have defined primary key although some of them have unique indexes. For example there exists table USER with defined PK. There exists another table ACCESS_RIGHTS which has foreign key to this USER table but the table does not have PK itself.

Have you any idea???
thanxs for answer.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2003 4:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
FAQ: http://hibernate.bluemars.net/117.html#A21

Well you can define a compound key over the fields that make up the unquie combination. The relationships are mapped as you normally would when using a compound key.


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.