davout wrote:
gavin wrote:
Another (much better) approach is to use HB3 subselect fetching.
Before I make a jump to ver 3, I'd like to take a look at this. Is there any documentation for this? The doc currently says: TODO
Thanks.
I follow davout asking for a documentation. The feature is exactly that what I wanted, but it would be interesting to know "how".
Taking a look into the DTD of hibernate3 offers that the fetch attribute of set, bag etc. can take the argument "subselect".
I assume it could be done this way:
[code]
<class name="sample.Entity" table="ENTITY">
<id name="id" type="long">
<column name="ENTITY_ID" not-null="true" />
<generator class="native" />
</id>
<set name="properties" table="ENTITY_PROPERTY" lazy="false" cascade="all-delete-orphan"
fetch="subselect">
<key column="ENTITY_ID" />
<many-to-many class="sample.Property" column="PROPERTY_ID" />
</set>
[code]
Am I right?[/b][/code]