Hibernate version: 3.0
I'm trying to create an 'addon' type structure, where I have a Parent.har containing a Parent.class and a Parent.hbm.xml.
Code:
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;
Code:
<?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 har files, to the above mentioned ORM parent object. Something as simple as given below.
Code:
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....