Hi All, I have a Parent, Child relationship with the following configuration (please do not worry about typo mistakes) <class name="Parent"> <id column="parent_id" name="identity" type="java.lang.Long"> <generator class="sequence"> </generator> </id> <property name="created" type="java.util.Date" /> <set name="childSet" lazy="false" inverse="true" fetch="subselect" > <key column="parent_id" /> <one-to-many class="Parent" /> </set> </class>
<class name="Child"> <id column="child_id" name="identity" type="java.lang.Long"> <generator class="sequence"> </generator> </id> <property name="created" type="java.util.Date" /> <many-to-one name="parent" column="parent_id" class="Parent" /> </class>
Please note i have lazy="false" inverse="true" fetch="subselect" in the Parent configuration.
If i use a criteria like this Criteria crit = session.createCriteria(Parent.class); crit..createCriteria("childSet");
Will this query overrides the above configuration mentioned in Parent.hbm.xml file (ie lazy="false" and fetch="subselect")
Also if i use a criteria like this Criteria crit = session.createCriteria(Parent.class).setFetchMode("childSet",FetchMode.JOIN);
Will this query overrides the above configuration mentioned in Parent.hbm.xml file (ie lazy="false" and fetch="subselect").
If the above two criterias will not override the .hbm.xml configuration, can someone specify in which way can i override?
Thanks in advance.
|