thanks for your answer firt. here is ant target used to produce hibernate mapping files:
Code:
<target name="hbm" depends="compile">
<taskdef name="hibernatedoclet" classname="xdoclet.modules.hibernate.HibernateDocletTask">
<classpath>
<fileset dir="${xdoclet.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<hibernatedoclet destdir="${classes.dir}" excludedtags="@version,@author,@todo"
force="true" verbose="true" mergedir="${classes.dir}">
<fileset dir="${src.dir}">
<include name="**/dos/*.java"/>
</fileset>
<hibernate version="2.0"/>
</hibernatedoclet>
</target>
. Question.java
Code:
public class Question
{
private Long _id;
private String _subject;
public Question() {}
/**
* @hibernate.id column="id" generator-class="native"
*/
public Long getId() {
return _id;
}
public void setId(Long id) {
_id = id;
}
/**
* @hibernate.property
* column="subject" lenght="30" not-null="true"
*/
public String getSubject() {
return _subject;
}
public void setSubject(String subject) {
_subject = subject;
}
......
When using xdoclet-1.2.2. and run "ant hbm", no output generated :(
it seems xdoclet doesnot see Question.java ?!