-->
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: Mixed mapping problem
PostPosted: Thu Aug 26, 2010 8:03 am 
Newbie

Joined: Thu Aug 26, 2010 7:12 am
Posts: 1
I have mixed table per class with table per subclass hierarchy like this:

Code:
<class name="ClassA" table="TBL_A" >   
        <discriminator column="discr" type="string" />
        <!-- some properties of class A here -->       
</class>

<subclass name="ClassB" extends="ClassA" discriminator-value="typeB" >   
        <join table="TBL_B">
                <key ....>
                <!-- some properties of class B here -->       
        </join>
</class>


I have class C inherited from B. I want to store properties of ClassC in TBL_B
so
Code:
<subclass name="ClassC" extends="ClassB" discriminator-value="typeC" >
       <!-- some properties of class C here -->
<subclass/>

will store properties in root hierarchy class table - TBL_A

Code:
<subclass name="ClassC" extends="ClassB" discriminator-value="typeC" >
       <join table="TBL_B">
                 <key ....>
                 <!-- some properties of class C here -->
       </join>
<subclass/>

will not work correctly

Code:
<subclass name="ClassC" extends="ClassА" discriminator-value="typeC">
<!-- inherit mapping from ClassА  with copy-paste properties of B-->
   <join table="TABLE_B">
       <key ....>
       <!-- some properties of class B here -->
       <!-- some properties of class C here -->       
   <join/>
<subclass/>

does not support polymorphyc querries by ClassB

So i did not find solution on http://docs.jboss.org/hibernate/core/3. ... tance.html Is this kind of mapping mixture is imposible in hibernate?


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.