-->
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: Collection of inherited objects
PostPosted: Wed Mar 28, 2007 11:03 am 
Newbie

Joined: Wed Mar 28, 2007 10:42 am
Posts: 1
Hello Everybody,

I have the following DB schema (A,B,C,D and E are tables, the - sign shows association):

A-B-C
B-D
B-E

A-B is one-to-many
B-C is one-to-one
B-D is one-to-one
B-E is one-to-one

C, D and E are inherited from B.

ex:
<class name="B">
<many-to-one name="ownerA" class="A">
<column name="a_id" not-null="true" />
</many-to-one>
...
</class>

<joined-subclass name="C" extends="B">
<key column="b_id"/>
...
</joined-subclass>


In A I want to have collections of C D E seperatelly.

So I want to use:

<set name="collC">
<key column="a_id">
<one-to-many class="C" />
</set>

The problem is that tables C D and E do not have a column a_id. They are connected to table B by b_id column, and table B is connected with table A by a_id column.

Whan hib tries to initialize collC it claims that table C does not have column a_id.

DO you have any idea how to solve the problem ?

Many Thanks
Karol


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.