I am genarating hbm.xml files from annotated java classes. Attributes set in the annotations eg. (fetch = FetchType.EAGER/FetchType.LAZY, cascade = CascadeType.ALL/CascadeType.REFRESH) are not reflected in the generated hbm.xml files.
Here are my settings:
-------------------------------------------------------------------------------------
Annoation:
@OneToMany(targetEntity = com.xx.Period.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumns( { @JoinColumn(name = "\"Fk_LoanId\"") })
private Set periods;
-------------------------------------------------------------------------------------
Ant -Generation:
<target name="an2hbm" depends="compile" description="Generate hbm files">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.class.path" />
<taskdef name="annotationconfiguration" classname="org.hibernate.tool.ant.AnnotationConfigurationTask" classpathref="project.class.path" />
<hibernatetool destdir="${gen.root}/hbm">
<classpath>
<path location="${class.root}" />
</classpath>
<annotationconfiguration configurationfile="${config.dir}/SubTrxHibernate.cfg.xml" />
<hbm2hbmxml />
</hibernatetool>
</target>
------------------------------------------------------------------------------------
Target platform: java 1.4 (annotatations removed), hbm.xml-files, hibernate 3.2.5
How can I get the attributes (eg. fetch=, cascade=) generated to the hbm.xmls?
Many Thanx & Best Regards,
Jpropeller
|