I am trying to create a POJO to map xml files. I read something about adding an ant task to make this easy.
I added this xml below to my build-impl.xml project in Netbeans, but nothing happens:
<target name="codegen">
<echo>Zippzip</echo>
<taskdef name="hbm2java"
classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
classpathref="javac.classpath"/>
<hbm2java
output="generated/src/">
<fileset dir="cat/model/">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>
I'm new to Netbeans, ant and Hibernate, can anyone help me?
PS I really don't know what classpathref should be. I mean, I know that it should contain the path to the hibernate class. The real problem is that I do not know how to get the ant working.
: , script Hibernate3. script, . : hibernatetool org.hibernate.tool.ant.Hbm2JavaExporterTask ; script:
<target name="codegen">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.Hbm2JavaExporterTask">
<classpath refid="project.classpath" />
</taskdef>
<hibernatetool destdir="cat/model/">
<configuration configurationfile="hibernate.cfg.xml"/>
<hbm2java />
</hibernatetool>
</target>
Hibernate3, : http://docs.jboss.org/tools/2.1.0.Beta1/hibernatetools/html/ant.html#d0e2903