When I run hbm2java or hbmtemplate in ant, I get an error saying
[hibernatetool] freemarker.core.InvalidReferenceException: Expression c2h.isOneToOne is undefined on line 10, column 6 in pojo/Ejb3PropertyGetAnnotation.ftl.
As far as I can find, this problem was addressed exactly once before, here
http://community.jboss.org/message/326201#326201The original poster claims that fixing the dependency did it, but I am absolutely sure that is not the cause of the problem for me.
Code:
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib" />
<hibernatetool
destdir="src/main/java/" >
<jdbcconfiguration
configurationfile="src/main/resources/hibernate.cfg.xml"
revengfile="generate/reveng.xml"
packagename="com.yoshi.persistence.dao" />
<hbm2java
templatepath="generate/hibernate-tools-flt"
jdk5="true"
ejb3="true" />
<hbmtemplate
exporterclass="org.hibernate.tool.hbm2x.POJOExporter"
templatepath="generate/hibernate-tools-flt/pojo"
template="Pojo.ftl"
filepattern="{package-name}/{class-name}.java">
<property key="jdk5" value="true"/>
<property key="ejb3" value="true"/>
</hbmtemplate>
Also, Ejb3PropertyGetAnnotation.ftl works completely fine when using the eclipse plugin.
Can anyone point out some potential causes?
On the other hand, the c2j does not cause any error. For example, running hbmtemplate with the default dao.ftl finishes fine.
I see that AbstractExporter.setupContext() puts in the context both "c2h" and "c2j". Am I looking at the right place?
Thank you!