-->
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: Beginner Question: Composed Primary Keys
PostPosted: Mon Mar 01, 2004 10:05 am 
Newbie

Joined: Mon Mar 01, 2004 9:59 am
Posts: 8
Hi!

I have to decide wheter to use Hibernate or an other Mappingtool.
For those decision I neet an answert to the following question:

Does Hibernate support composed primary keys, for instance something like that:

create table master (
master_id int,
version int,
primary key pk_master (master_id, version)
);

create table detail(
detail_id int,
master_id int,
version int,
primary key pk_detail(detail_id)
);

alter table detail
add constraint fk_d_m foreign key (master_id, version) references master;

Best Regards
Manfred


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 10:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
yes, Hibernate supports composite ids. Refer to http://www.hibernate.org/hib_docs/reference/html/or-mapping.html#or-mapping-s1-4b


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.