Hi,
Initially it looked very straight forward to do this, but somehow I must have missed something down the road, I tried all sorts of things inside the <list> tag (see below) but failed, so I dug in the manual and in the forum but still couldn't find an answer...
I have a class which holds a list of children of the same class. Is it possible to map this to just one table ?
code fragment from class defenition:
Code:
public class CI implements java.io.Serializable {
private long id;
private int version;
protected CI parent;
protected List<CI> children;
mapping file:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="csmc.model.CI" table="ConfigurationItems">
<id name="id" column="CI_ID" unsaved-value="0">
<generator class="native"/>
</id>
<version name="version" column="VERSION"/>
<list name="children" cascade="all">
</list>
</class>
</hibernate-mapping>
the content of <list> tag is intentionally left out.
I'd appreciate any help.
Yaniv