-->
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: Inheritance with a foreign key wich isn't the primary key
PostPosted: Thu Mar 09, 2006 12:39 pm 
Newbie

Joined: Tue Feb 14, 2006 2:43 am
Posts: 5
Hello

I don't know how to map an inheritance relationship based on a field which is not the primary key of the table of the subclass.

For example with the application CaveatEmptor on the inheritance beetween BillingDetails and CreditCard the hbm is :

Code:
<class name="BillingDetails" table="BILLING_DETAILS" lazy="true">
   <id name="id" type="long"..... </id>
   <property ......

    <joined-subclass name="CreditCard" table="CREDIT_CARD">
        [b]<key column="CREDIT_CARD_ID"
          foreign-key="FK1_CREDIT_CARD_ID"/>[/b]       
    <property .......



But in the database if the relationship beetween BILLING_DETAILS and CREDIT_CARD is not on CREDIT_CARD_ID (Primary Key and also foreign Key) but on FK_BILLING_DETAILS, how can I do ?
I want CREDIT_CARD_ID as only a Primary Key not Foreign KEY too
and FK_BILLING_DETAILS as foreign Key.

Thanks for your help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 10, 2006 4:01 am 
Beginner
Beginner

Joined: Tue Mar 07, 2006 8:50 am
Posts: 20
did you find a solution to your problem ? because I would really like to do the same...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 7:19 am 
Newbie

Joined: Fri Mar 03, 2006 8:52 am
Posts: 5
Hello

I mentioned the same problem within my mappings! Does anyone know how to deal with such "workarounds"?


THX in advance,
Thomas


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.