Code:
<project name="HL_Hibernate" default="compile" basedir="../../../.">
<property file="ant.properties" />
<property name="server.config" value="default"/>
<property name="scr.dir" value="${basedir}/src"/>
<property name="package.name" value="hl/database"/>
<property name="compenent.name" value="or/hibernate"/>
<property name="jboss.home" value="/export/hl/COTS/jboss-4.0.1"/>
<property name="deploy.home" value="${jboss.home}/server/default/deploy"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="build.database.classes.dir" value="${build.classes.dir}/${package.name}"/>
<property name="build.database.classes.dir.map" value="$build.database.classes.dir}/map"/>
<property name="package.src.dir" value="${src.dir}/${package.name}/${compenent.name}/objects"/>
<path id="base.libraries">
<fileset dir="${jboss.home}/lib">
<include name="*.jar"/>
</path>
<target name="clean">
<delete dir="${build.database.classes.dir}"/>
<delete dir="${build.database.classes.dir.map}"/>
<delete file="${build.classes.meta_inf.dir}/jboss-service.xml"/>
</target>
<target name="prepare">
<mkdir dir="${build.database.classes.dir}"/>
<mkdir dir="${build.database.classes.dir.map}"/>
</target>
<target name="compile" depends="clean,prepare">
<javac scrdir="${package.src.dir}" destdir="${build.database.classes.dir}"
classpath="${build.database.classes.dir}"
debug="on" optimize="off" deprecation="on">
<classpath refid="base.libraries"/>
</javac>
</target>
<taskdef name="hibernatedoclet" classname="xdoclet.modules.hibernate.HibernateDocletTask" >
<classpath refid="base.libraries"/>
</taskdef>
<target name="generate-mappings" depends="compile">
<hibernatedoclet
destdir="${build.database.classes.dir.map}"
excludetags="@version,@author,@todo,@see,@desc"
addtags="@xdoclet-generated at ${TODAY}, @authore"
force="true"
verbose="true"
<fileset dir="${package.src.dir}">
<include name="*.java"/> ***This has also been tried: **/*.java
<include name="/exceptions/*.java"/>
<include name="/dao/*.java"/>
</fileset>
<hibernate version="2.0" (also tried 2.1) destinationfile="${0}.hbm.xml"/>
<jbossservice
destdir="${build.classes.meta_inf.dir}"
serviceName="Hibernate"
jndiName="jdbc/Sybase"
dataSource="jdbc/Sybase"
dialect="net.sf.hibernate.dialect.SybaseDialect"
useOuterJoin="true"
transactionManagerStrategy="net.sf.hibernate.transaction.JBossTransactionManagerLookup"
trancactionStrategy="net.sf.hibernate.transaction.JTATransactionFactory"
userTransacationName="UserTransaction"
depends="jboss.jca:service=LocalTxCm, name=DefaultDS"/>
</hibernatedoclet>
</target>
<taskdef name="schemaexport" classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"/>
<classpath refid="base.libraries"/>
<taskdef>
<target name="schemaexport">
<schemaexport
quiet="no"
text="no"
delimeter=";"
output="schema-export.sql">
<fileset dir="${build.database.classes.dir.map}">
<include name="*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
<target name="schemaupdate">
<taskdef name="schemaupdate"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaUpdateTask"/>
<classpath refid="base.libraries"/>
<schemaupdate
quiet="no"
<fileset dir="${build.database.classes.dir.map}">
<include name="*.hbm.xml"/>
</fileset>
</schemaupdate>
</target>
<target name="hibernate-sar" depends="generate-mappings">
<jar destfile="${build.dir}/hibernateStartup.jar">
<fileset dir="${build.database.classes.dir}">
<include name="/map/*.hbm.xml"/>
<include name="*.class"/>
</fileset>
<metainf dir="${build.classes.meta_inf.dir}" >
<include name="jboss-service.xml"/>
</metainf>
</jar>
<antcall target=schemaexport" />
</target>
</project>
That is my whole build file. I copied the example .java files from hibernte and put them in my src where my files were. Of course, I changed the package. I ran the generate-mappings task and it generated the .hbm.xml mapping files but only for the example classes. Why is that. I noticed that most of them extended a class Persistent but none of them had any of the hibernate xdoclet tags in them. How did it generate these mapping files. Why would it not ever again. I am sure it is something small that I have overlooked but I've got nothing left to try. All of my classes implement Serializable but don't extend anything. They do all have no arg constructors. I just don't get it. What I have I missed?
Thank in advance. You can also feel free to email me @ jacky@itmc-wo.com if it is easier to correspond that way.