-->
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: how to define fetchprofile in xml on hierarchical entities
PostPosted: Tue Jan 17, 2012 5:12 am 
Newbie

Joined: Tue Jan 17, 2012 5:07 am
Posts: 1
Full topic is : how to define fetch profile in hibernate mapping on hierarchical entities

Hi, I have a class hierarchy like

Code:
class A
{
   B b;
}


Code:
interface B
{}


Code:
class C implements B
{
}


Code:
class D implements B
{
}


In my hibernate mapping file for entity A, the defenition is like;

Code:
<any id-type="long" name="b" meta-type="int" cascade="none">
<meta-value value="1" class="C"/>
<meta-value value="2" class="D"/>
<column name="BTYPE" length="2"/>
..
</any>


I want to fetch entity A with its value which implements B eagerly, sometimes I dont want. So I need to use a fetch profile(also I dont want duplicate HQL methods for this):

Code:
<fetch-profile name="a-with-b">
<fetch association="b" style="join"/>
</fetch-profile>


But this doesn't work because of b. What sholud be done for this situation?


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.