Ok the parent is called ModelElement and the hbm is that:
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 package="com.integration.core">
<class name="ModelElement" table="model_element">
<id name="uuid" type="string" column="uuid">
<generator class="uuid"/>
</id>
<discriminator column="type" type="string"/>
<property name="name" column="name" type="string" not-null="true"/>
<property name="created" column="created" type="timestamp" update="false" not-null="true"/>
<property name="stereotype" column="stereotype" type="string" not-null="true"/>
<property name="description" column="description" type="string" not-null="false"/>
<set name="attachments" table="attachment" lazy="true">
<key column="uuid"/>
<one-to-many class="com.integration.model.Attachment"/>
</set>
<many-to-one name="parent" class="ModelElement" access="property" cascade="save-update, persist, merge">
<column name="parent_uuid" not-null="false"/>
</many-to-one>
<set name="childElements" access="property" cascade="all" inverse="true">
<key column="parent_uuid"/>
<one-to-many class="ModelElement"/>
</set>
<set name="associationsA" table="association" lazy="true">
<key column="uuidA"/>
<one-to-many class="com.integration.model.associations.Association"/>
</set>
<set name="associationsB" table="association" lazy="true">
<key column="uuidB"/>
<one-to-many class="com.integration.model.associations.Association"/>
</set>
<set name="designDecisions" table="modelElement_designDecision" lazy="true" cascade="save-update">
<key column="model_element_id"/>
<many-to-many class="com.integration.model.DesignDecision" column="design_decision_id"/>
</set>
<subclass name="com.integration.model.Task" discriminator-value="task">
<set name="issues" table="issue" inverse="true">
<key column="task_uuid"/>
<one-to-many class="com.integration.model.Issue"/>
</set>
<join table="task">
<key column="uuid"/>
<property name="assignedTo" column="assigned_to" type="string" not-null="true"/>
<property name="priority" column="priority" type="string" not-null="true"/>
<property name="percentCompleted" column="percent_completed" type="string" not-null="true"/>
<property name="estimatedEffort" column="estimated_effort" type="string" not-null="true"/>
<property name="executedEffort" column="executed_effort" type="string" not-null="true"/>
<property name="status" column="status" type="string" not-null="true"/>
<property name="initialDate" column="initial_date" type="string" not-null="true"/>
<property name="finishDate" column="finish_date" type="string" not-null="true"/>
</join>
</subclass>
<subclass name="com.integration.model.Issue" discriminator-value="issue">
<join table="issue" fetch="select">
<key column="uuid"/>
<property name="impact" column="impact" type="string" not-null="true"/>
<property name="openingDate" column="opening_date" type="string" not-null="true"/>
<property name="commitmentDate" column="commitment_date" type="string" not-null="true"/>
<property name="closingDate" column="closing_date" type="string" not-null="true"/>
<property name="assignedTo" column="assigned_to" type="string" not-null="true"/>
<property name="status" column="status" type="string" not-null="true"/>
<property name="criticity" column="criticity" type="string" not-null="true"/>
<many-to-one name="task" class="com.integration.model.Task" column="task_uuid"/>
</join>
</subclass>
</class>
</hibernate-mapping>
when i call
Code:
Task task = (Task)hsession.get(Task.class, "402880e60714fbbd010714fc6a2d0001");
System.out.println("ASSIGNED TO: " +task.getAssignedTo());
System.out.println("ISSUES.SIZE: " +task.getIssues().size());
i got the problem
thanks