Hey all, ...hope I'm posting in the right place. We're running Hibernate 3.0 and have disabled lazy loading for several collections on one class (See below for a section of .hbm.xml). My question is this. We want to have lazy loading disabled on all collections in all but one case, since we typically only get one instance of this class at a time. We recently had to write a job to dump tens of thousands of these rows to a log file for audit purposes (waste of bytes I know) and all we need are the fields off class. I can do a "sql report" with these fields but it would be better if I get the actual object and "enable" lazy loading for this class in this one-off instance. Is this posslbe?
<hibernate-mapping> <class ...> ...company nonsense removed... <many-to-one name="tracker" column="mainID" class="MyCustomClass" lazy="false" insert="false" update="false"/> <property name="numComplete" type="java.lang.Integer"> <column name="Num_Complete" /> </property>
<property name="numItems" type="java.lang.Integer"> <column name="Num_Items" /> </property> <property name="numNeedReview" type="java.lang.Integer"> <column name="Num_Need_Review" /> </property>
<property name="complete" type="boolean"> <column name="Complete" not-null="false" /> </property>
<property name="lastUpdate" type="timestamp"> <column name="Last_Update" not-null="true" /> </property> ...company nonsense removed... </class> </hibernate class>
|