-->
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: Need help with complex mapping
PostPosted: Wed Sep 06, 2006 4:31 pm 
Newbie

Joined: Wed May 17, 2006 9:46 pm
Posts: 3
Hi all,

I have a fairly complex mapping I'm trying to represent and I'd appreciate it if someone could help me out. I'm mapping a hierarchy which i have done successfully using joined-subclass. One of the subclasses has an array containing another class hierarchy. This hierarchy is represented using a discriminator and the class has no ID property. I cannot change the code.

So here is my basic mapping and where my questions come in:

<class name="events.TestParentOwnerParent" table="OWNERPARENT">
<id name="id" column="id" type="string">
<generator class="assigned"/>
</id>

<property name="prop" type="string"/>
</class>

<joined-subclass name="events.TestParentOwner" extends="events.TestParentOwnerParent" table="OWNER">

<key column="owner_id"/>

<array name="parents" table="TEST_PARENTS" cascade="all">
<key column="owner_id"/>
<list-index column="ARRAY_INDEX" />
<many-to-many column="TESTPARENT_ID" class="events.TestParent"/>
</array>
</joined-subclass>

<class name="events.TestParent" table="TEST_PARENT_TYPE" discriminator-value="AGC">

<id column="uid" type="long">
<generator class="native"/>
</id>

<discriminator column="TYPEA_CHILD_TYPE_DISCRIMINATOR" type="string" />

<subclass name="events.TestChildA" discriminator-value="HP">
<property name="host" type="string" />
<property name="port" type="int" />
</subclass>

<subclass name="events.TestChildB" discriminator-value="DG">
<property name="name" type="string" />
</subclass>
</class>

The above works but really I would like to inline TestParent and its children into the table representing the array in the TestParentOwner class eliminating the extra table. Does anyone know how to do this?


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.