-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: .hbm.xml files not generated form XDoclet tags
PostPosted: Wed Jul 05, 2006 8:15 am 
Newbie

Joined: Wed Jul 05, 2006 8:00 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.