-->
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.  [ 1 post ] 
Author Message
 Post subject: Two composite unique keys for a table-mapping
PostPosted: Sat Mar 06, 2004 9:22 am 
Newbie

Joined: Fri Mar 05, 2004 2:52 am
Posts: 15
hi,
If a table has two unique composite keys (for that matter,more than one), can they be included in the primary key class ? and mapping file of a domain object?

so that other domain objects may establish relationships (one-to-many or many-to-many or many-to-one)with any key they like..

suppose consider this scenario (these tables)

parent
======
id int
id1 int
name varchar

suppose one composite key here is (id,name)
and other is (id1,name)

so can we have two <composite-id> tags in the Parent domain object??

child
====
child_id int (refers id of parent)

child_id1 int (refers id1 of parent)
name varchar

suppose one composite key here is (child_id,name)

and other composite key can be (child_id1,name)


so in the Child domain object mapping also two <composite-id> tags,is it possible???

hope I am not asking a very weird question,

thanks for any help!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.