0 Replies Latest reply on Apr 30, 2004 7:40 AM by itchyoinker

    XDoclet won't generate my .hbm.xml

    itchyoinker

      Hi folks,


      I can't get XDoclet to generate my .hbm.xml files. and it doesn't give me any feedback as to why (or maybe I don't know where to look?). JBoss-service.xml gets created via jbossservice though, so at least I know that the hibernatedoclet task is getting processed.

      Question:
      Since my projects will always be small one-man develpment efforts (me) and I don't have an unlimited time-budget for learning XDoclet, do you think it is worth using it instead of hand-writing the various files? Or will I spend more time debugging XDoclet than hand-writing the scripts?


      The Code:
      If you really have patience, I posted part of my build.xml script down below, as well as my .java fiile. It's not a whole lot, but if anyone can look over it and possibly give me some ideas, then I'd really be greatful.

      Itchy



      HERE IS PART OF MY build.xml:
      NOTE: I repaced '<' and '>' with '(' and ')' so that I could post this here!

      (property name="build.hibernate" location="${build.resources}/hibernate/com/sar/hibernate"/)
      (property name="src.business" location="${src}/business/com/jzudi/business"/)

      (target name="xdoclet" depends="jar"
      description="Generates Hibernate class descriptor files.")

      (taskdef name="hibernatedoclet"
      classname="xdoclet.modules.hibernate.HibernateDocletTask")
      (classpath refid="xdoclet.classpath"/)
      (/taskdef)


      (hibernatedoclet
      destdir="build.hibernate"
      excludedtags="@version,@author,@todo"
      force="true"
      verbose="true"
      mergedir="build.hibernate")

      (fileset dir="${src.business}")
      (include name="*.java"/)
      (/fileset)

      (hibernate version="2.0"/)
      (/hibernatedoclet)
      (/target)



      HERE IS MY CLASS:
      package com.jzudi.business;

      import java.util.Set;
      import java.util.Collections;

      /**
      *
      * @author IO
      * @since 1.0
      * @hibernate.class table="Company"
      */


      public class Company {

      private String companyID;
      private String companyName;
      private String companyContact;
      private String street;
      private String zip;
      private String city;


      private Set companies = Collections.EMPTY_SET;

      Public Company(){
      }


      /**
      *
      * @hibernate.set role="company"
      *
      * @hibernate.collection-key column="Company_ID"
      *
      * @hibernate.collection-one-to-many class="Company"
      */

      public Set getCompanies() {
      return(companies);
      }

      /***/
      public void setCompanies(Set object) {
      companies = object;
      }



      /**
      * @hibernate.id generator-class="assigned" type="string" column="Company_ID"
      * @return String
      */
      public String getCompanyID() {
      return (companyID);
      }


      /**
      * @hibernate.property
      *
      */

      public String getCompanyName() {
      return (companyName);
      }
      /**
      * @hibernate.property
      *
      */

      public String getContactPerson() {
      return (contactPerson);
      }

      /**
      * @hibernate.property
      *
      */

      public String getStreet() {
      return (street);
      }

      /**
      * @hibernate.property
      *
      */

      public String getZIP() {
      return (zip);
      }

      /**
      * @hibernate.property
      *
      */

      public String getCity() {
      return (city);
      }




      private void setCompanyID(String string) {
      companyID = string;
      }

      public void setCompanyName(String string) {
      companyName = string;
      }

      public void setContactPerson(String string) {
      contactPerson = string;
      }

      public void setStreet(String string) {
      street = string;
      }


      public void setZIP(String string) {
      zip = string;
      }

      public void setCity(String string) {
      city = string;
      }

      }