I found this:
http://www.hibernate.org/hib_docs/refer ... mance.html
The very last section 19.1.7. seems to be what we need.
I put the ant task in my build script after the compile section and everything builds fine, but the collections are still not lazy.
I am using the following in my bean:
Code:
@Formula("(SELECT COUNT(u.user_id) FROM users u WHERE u.X > X)")
@Basic(fetch=FetchType.LAZY)
protected Integer newVar;
I am using Netbeans to manage my ant building and put the following into my build-impl.xml file
Code:
<target name="instrument" depends="compile">
<taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask">
<classpath path="${build.generated.dir}/lib"/>
<classpath path="${build.classes.dir}"/>
<classpath refid="lib.class.path"/>
</taskdef>
<instrument verbose="true">
<fileset dir="${build.generated.dir}/classes/com/XXX/beans">
<include name="*.class"/>
</fileset>
</instrument>
</target>