Hi,
I'm getting a
org.hibernate.PropertyNotFoundException: field not found: numero with this mapping.
Can anybody help me please?
Thanks,
Andre
Animal.hbm.xml
Code:
<class name="Animal" table="ANIMAL" catalog="REBANHO">
<id name="numero" type="int">
<column name="NR_ANIMAL" />
<generator
class="AnimalIdentifierGenerator" />
</id>
<discriminator formula="IN_GENERO"/>
<subclass name="Femea" discriminator-value="F">
<one-to-one name="ipt" class="IPT" />
<join table="FEMEA">
<key column="NR_ANIMAL" />
</join>
</subclass>
</class>
IPT.hbm.xmlCode:
<class name="IPT" table="IPT" catalog="rebanho">
<id name="numero" column="NR_FEMEA">
<generator class="foreign">
<param name="property">femea</param>
</generator>
</id>
<one-to-one name="femea" class="Femea" constrained="true" />
</class>
Animal.javaCode:
public abstract class Animal {
private Integer numero;
}
Femea.javaCode:
public class Femea extends Animal {
private IPT ipt;
}
IPT.javaCode:
public class IPT {
private Femea femea;
}