Since the child is the same class as the parent, I am guessing it would have to be an entity - even though the child instance is dependent on the parent instance.
This is kind of confusing to me - would it look like this?
table:FOO
columns:
pkid int,
bar varchar(100),
parent_id int,
child_id int
Code:
public class Foo {
String bar;
Foo myChild;
Foo myParent;
}
<class name="Foo" table="FOO">
<id name="id" column="pkid" type="int">
<generator class="native"/>
</id>
<property name="bar"/>
<component
name="myChild"
class="eg.Foo" >
<property name="bar" column="bar"/>
<parent name="myParent"/>
</component>
</class>
How does the component get mapped to the child_id/parent_id columns ?