Hi, i am trying to use in inheritance mapping.
So, i have a Super Class Artikel and one child class FremdArtikel. Furthermore i have a link from FremdArtikel to Artikel.
So, how can i do that?
My Mapping looks like that:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class
name="hello.Artikel"
table="artikel">
<id
name="id"
column="id">
<generator class="native"/>
</id>
<property
name="ItemCode"
column="ItemCode"/>
<property
name="ItemName"
column="ItemName"/>
<property
name="Description"
column="Description"/>
<joined-subclass name="FremdArtikel"
table="fremdartikel">
<key column="ID"/>
<many-to-one name="refitem" class="Artikel" column="refitem"/>
</joined-subclass>
</class>
</hibernate-mapping>
And the FremdArtikel Class looks like that:
Code:
public class FremdArtikel extends Artikel{
private int RefItem;
public int getRefItem() {
return RefItem;
}
public void setRefItem(int RefItem) {
this.RefItem = RefItem;
}
public FremdArtikel() {
}
}
But i get the error message:
org.hibernate.MappingException: An association from the table fremdartikel refers to an unmapped class: Artikel after compiling.
what did i do wrong?
best regards
Philipp