- Hibernate 2.1.4 & 2.1.2
- MS SQL Server 2000
- Product -> ProductDescriptions (1-m)
Code:
<map
name="descriptions"
table="product_detail"
lazy="true"
sort="unsorted"
inverse="false"
cascade="all">
<key column="product_id"></key>
<index column="locale"
type="string" />
<one-to-many
class="com.fgl.fwp.model.products.ProductDescription" />
</map>
- I'm trying to fetch products with the descriptions already instantiated using:
Code:
select p from Product as p inner join fetch p.descriptions
each product has two descriptions so the List returned from the query contains the same product instance twice.
I can take the list and put into a set to remove the duplicates, but I'm wondering if there is a way for me to get my intended results without having to resort to this.
thanks,
Darcy.