[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - How to generate separate xml files with Xdoclet when using i
Hoagiex
do-not-reply at jboss.com
Tue Jul 18 05:09:28 EDT 2006
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....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958702#3958702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958702
More information about the jboss-user
mailing list