Hibernate version: 3.3.1
Hi, we have an object structure that looks like this:
ProdTypes have multiple attributes (List)
Attributes have multiple AttributeValues (List)
We are creating a criteria query like this:
crit.add(Restrictions.eq("prodTypeId", id))
.setFetchMode("attributes", FetchMode.JOIN)
.setFetchMode("attributes.attributeValues", FetchMode.JOIN)
.setFetchMode("attributes.xmlTags", FetchMode.JOIN)
.createCriteria("attributes", Criteria.LEFT_JOIN).add(Restrictions.isNotNull("attributeValues"))
.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
We are getting back the correct number of ProductTypes, but the Attribute List has many duplicate records. Is there are way to put the Distinct Root Entity option on the Attribute object as well as the ProdType object?
Thanks,
Chris
|