I have a problem simillar to this post
http://forum.hibernate.org/viewtopic.php?p=2182874
however what is said there does not help me :(.
I have a java class with XDoclet to create a hbm file. However the hbm file is not generated.
Here is the class
package src.hibernate;
/**
* @author Alex *
* @hibernate.class table = "SAMPLE"
*/
public class Sample{
private Long id;
private String name;
private int age;
public Sample(){}
/**
* @hibernate.id unsaved-value="0" generator-class="increment" type="long"
* @return Long
*/
public Long getId() {
return id;
}
/**
* Sets the id.
* @param id The id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
* @hibernate.property column="AGE"
* @return
*/
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
/**
* @hibernate.property column="NAME"
* @return
*/
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Here is the build.xml
<?xml version="1.0" encoding="UTF-8" ?>
<project name="XDOCLET XML" default="generate" basedir=".">
<property name="src.home" value="${basedir}/src"/>
<property name="lib.home" value="${basedir}/lib"/>
<property name="generated.home" value="${basedir}/hbm"/>
<target name="generate"
description="Generates Hibernate class descriptor files." >
<echo>Starting generate-hbm-from-xdoclet</echo>
<!-- Define the hibernatedoclet task -->
<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask">
<classpath>
<fileset dir="${lib.home}/xdoclet">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<!-- Execute the hibernatedoclet task -->
<hibernatedoclet
destdir="${generated.home}"
excludedtags="@version,@author,@todo"
force="true"
mergedir="${generated.home}"
verbose="true">
<fileset dir="${src.home}">
<include name="**/hibernate/*.java"/>
</fileset>
<hibernate version="3.0"/>
<hibernatecfg
dialect="net.sf.hibernate.dialect.MySQLDialect"
driver="com.mysql.jdbc.Driver"
jdbcUrl="jdbc:mysql:///${database.name}"
userName="hibernate"
password="aPassword"/>
</hibernatedoclet>
<echo message="hibernate.dir = ${generated.home}" />
</target>
</project>
The hibernate.cfg.xml is generated but the maping of the Sample.class is not