-->
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: any collection and left join fetch
PostPosted: Wed Oct 12, 2005 2:35 pm 
Newbie

Joined: Tue Apr 20, 2004 3:52 am
Posts: 2
Hi all,

I would like to know if it is possible to use left join fetch with any collection type.

My mapping is the following:
...
<id name="id" column="ID" type="java.lang.String">
<generator class="uuid.hex">
</generator>
</id>

<property name="boId" type="java.lang.String" update="false" insert="false">
<column name="BOID" length="250" index="BC_CHANNEL_CONTAINER_BOID"/>
</property>

<property name="boType" type="java.lang.String" update="false" insert="false">
<column name="BOTYPE" length="250" index="BC_CHANNEL_CONTAINER_BOTYPE"/>
</property>

<property name="status" type="java.lang.String" update="true" insert="true">
<column name="STATUS" length="250" index="BC_CHANNEL_CONTAINER_STATUS"/>
</property>

<property name="timestamp" type="timestamp" update="true" insert="true">
<column name="TIMESTAMP" length="250" index="BC_CHANNEL_CONTAINER_TIMESTAMP"/>
</property>

<property name="sourceReference" type="java.lang.String" update="true" insert="true">
<column name="SOURCEREFERENCE" length="250" index="BC_CHANNEL_CONTAINER_SOURCEREFERENCE"/>
</property>

<any name="internalObject" id-type="string" meta-type="string">
<meta-value value="Activity" class="activityType"/>
<meta-value value="Commission" class="commissionType"/>
<meta-value value="Position" class="positionType"/>
<column name="BOTYPE"/>
<column name="BOID"/>
</any>
</class>
</hibernate-mapping>


The query I try to run is the following:

"select c from ChannelContainer c " +
"where c.status = 'APPROVED'" +
" left join fetch c.internalObject"


This query do not work, hibernate throw an exception with cause = path expression ends in a composite value.

If it is not possible to use left join fetch, is there another way of not having hibernate retrieving the linked records one by one with multiple select but in one query only?

Thanks,


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.