Hello,
I'm trying to map a class which can be composed of element of the same class. Let's consider this class :
Code:
class Element {
private int id;
private Element fatherElement;
// get/set...
}
Here's my current mapping :
Code:
<class name="Element" table="element_table">
<id name="id" column="id_element">
<generator class="increment"/>
</id>
<many-to-one name="fatherElement" column="id_father_element" class="Element"/>
</class>
The is problrem is as follow : when I try to query on Element.fatherElement.id, an exception is throwed : "could not resolve property: id".
Is there something I'm doing wrong ? I'm not used to Hibernate.
Thanks.