-->
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: not-found, map, inheritance
PostPosted: Wed May 23, 2007 10:41 am 
Newbie

Joined: Wed May 23, 2007 10:06 am
Posts: 5
i have classes like:

class X{
map<AB, Y> ABs;
map<AC, Y> ACs;
}

class Y{
string info
}

class A {
map <X, Y> Xs;
}

class AB estends A{
string info2
}

class AC extends A{
integer amount;
}

with mapping

for X:
<id ... column="X_id"...>

<map name="ABs" inverse="true">
<key column="X_id" not-null="true"/>
<map-key-many-to-many column="A_id" class="AB" />
<one-to-many class="Y"/>
</map>

<map name="ACs" inverse="true">
<key column="X_id" not-null="true"/>
<map-key-many-to-many column="A_id" class="AC" />
<one-to-many class="Y"/>
</map>

for Y
<id ... column="Y_id"...>
.....

for A, AB and AC
<class name="A"....>
<id... column="A_id"..>

<map name="Xs">
<key column="A_id" not-null="true"/>
<map-key-many-to-many column="X_id" class="X" />
<one-to-many class="Y"/>
</map>

<union-subclass name="AB".....>
.....
</union-subclass>

<union-subclass name="AC".....>
.....
</union-subclass>
</class>

Let x be an object of class X, a of class A and so on.

When I add x to Xs of some ab, and the same x to Xs of some ac, then both ABs and ACs of x have 2 elements (should be 1), and when i try to use them i got row not found exception for one of those 2 elements in each map.

How to cope with that? i tried to add not-found="ignore" in <map-key-many-to-many> but UNFORTUNATELY it is not supported there (while its supported in many-to-many), experimented witch fetches and some other things but it didnt work. What should I do to make it work?

I have to have Xs map in A

Thank you in advance for 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.