Hibernate descriptor:
Code:
<hibernate-mapping>
<class
name="com.cdo.Rating"
table="RATING"
dynamic-update="false"
dynamic-insert="false"
mutable="false"
>
<id
name="id"
column="id"
type="java.lang.Long"
>
<generator class="native">
</generator>
</id>
<set
name="defaultProbabilities"
lazy="true"
inverse="false"
cascade="none"
sort="unsorted"
>
<key
column="ratingId"
/>
<one-to-many
class="com.db.gm.risk.vo.cdo.DefaultProbability"
/>
</set>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Rating.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
HQL query:
Code:
SELECT DISTINCT rating from com.db.gm.risk.vo.cdo.Rating AS rating join fetch rating.defaultProbabilities as defaultProbability"
The above query returns duplicates. If I remove the fetch no duplicates. Am I missing something?
Many thanks!!!!!