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,
|