Below is a simple domain object:
[code]
package org.petsoar.pets;

/**
* @hibernate.class table='PETS'
*/
public class Pet {
 private long id;

 /**
 * @hibernate.id generator-class="increment"
 */
 public long getId() {
  return id;
 }
 public void setId(long id) {
  this.id = id;
 }
}[/code]

Corresponding part of build.xml:
[code]
 <target name="config" depends="compile" description="Generate hbm files">
  <taskdef name="hibernatedoclet"
   classname="xdoclet.modules.hibernate.HibernateDocletTask">
   <classpath>
    <fileset dir="${lib.dir}">
     <include name="**/*.jar"/>
    </fileset>
   </classpath>
  </taskdef>
  <hibernatedoclet destDir="${src.dir}">
   <fileset dir="${src.dir}">
    <include name="**/*.java"/>
   </fileset>
   <hibernate version="3.0"/>
  </hibernatedoclet>
 </target>
[/code]

The generated Pet.hbm.xml£º
[code]
<?xml version="1.0" encoding="UTF-8"?>

<hibernate-mapping
>
    <class
        name="org.petsoar.pets.Pet"
******************************************here!
    >

        <id
            name="id"
            column="id"
            type="long"
        >
            <generator class="increment">
              <!--
                  To add non XDoclet generator parameters, create a file
named
                  hibernate-generator-params-Pet.xml
                  containing the additional parameters and place it in your
merge dir.
              -->
            </generator>
        </id>

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-Pet.xml
            containing the additional properties and place it in your merge
dir.
        -->

    </class>

</hibernate-mapping>
[/code]

Please take a look at the line with asterisks. I tell xdoclet that I want a
table named 'PETS', but the generated hbm.xml don't have the attribute.

---
Regards,
Merlin Ran






-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
xdoclet-user mailing list
xdoclet-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to