0 Replies Latest reply on Jul 18, 2006 5:09 AM by Hoagie X

    How to generate separate xml files with Xdoclet when using i

    Hoagie X Newbie

      I'm trying to create an 'addon' type structure, where I have a Parent.jar containing a Parent.class and a Parent.hbm.xml.

      package mypackage;
      
      /**
       * @hibernate.class
       * table = "parents"
       *
       */
      public class
      Parent
      {
       public
       Parent()
       {
       }
      
       /**
       * @hibernate.id
       * column = "id"
       * type = "long"
       * generator-class = "native"
       *
       * @return
       */
       public Long
       getID()
       {
       return theID;
       }
      
       public void
       setID(Long anID)
       {
       theID = anID;
       }
      
       private Long theID = null;
      


      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
      
      <hibernate-mapping
      >
       <class
       name="mypackage.Parent"
       table="parents"
       >
      
       <id
       name="ID"
       column="id"
       type="long"
       >
       <generator class="native">
       </generator>
       </id>
       </class>
      
      </hibernate-mapping>
      
      


      Now I wan to be able to add separate extending objects, which are placed in seperate jar files, to the above mentioned ORM parent object. Something as simple as given below.

      package mysecondpackage;
      
      import mypackage.Parent;
      
      /**
       * ?????????????????
       */
      public class
      Child
      extends Parent
      {
       public
       Child()
       {
       }
      


      The only problem is, that I want the Child.hbm.xml to declare the inheritence and not the Parent.hbm.xml. Although the hibernate docs say it's possible, I can't seem to get it working with polymophism working.

      If someone knows how to realize this, please enlighten me :)
      Also, can it only be done manually?... because I can't find any tags for Xdoclet that would allow it to be done automatically....