Hibernate version: 3.3
Spring version: 2.5
MyFaces version: 1.2
ICEFaces version: 1.7.1
Here is the mapping of the parent class:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="myPackage" auto-import="true">
<class name="Standort" table="STANDORT" >
<id name="id" type="long" column="`ID`">
<generator class="native" />
</id>
<!-- other props omitted -->
<list name="technischeEinheiten" cascade="save-update" lazy="false">
<key column="STANDORT_ID" not-null="true"/>
<list-index column="TE_INDEX" />
<one-to-many class="TechnischeEinheit" />
</list>
</class>
</hibernate-mapping>
Mapping of the child class:
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="myPackage" auto-import="true">
<class name="TechnischeEinheit" table="TECHNISCHE_EINHEIT">
<id name="id" type="long" column="ID">
<generator class="native" />
</id>
<!-- back ref to parent for navigatability -->
<many-to-one name="standort" class="Standort" column="STANDORT_ID" not-null="true" insert="false" update="false" lazy="false" />
<!-- other properties omitted -->
</class>
</hibernate-mapping>
Before I am posting any code I want to make sure that my understanding of OSIV is correct, so I can post the relevant sources.
My App is using Springs OSIV filter, everything works quite well, Entities can be persisted an loaded, half of the App is already up and running. But for some reason, some List-Properties of my Entities just disappear in the JSF-Action Methods. There is a mapped parent entity that holds a list of mapped child entities, object graph is build up correctly and also correctly retrieved from DB. Now, when an Item is added to that list, the parent entity is still there but the list of children is empty.
Whenever a JSF action methods adds a child to the parents list, this list is already empty, only containing the just added child. So in the resulting view only the last added item is visible. Navigating away and back reloads the correct list. So, where are the childrens gone?
Do I have to merge or somehow reattach the parent to the session prior to adding items to the list? If so, where should this be done, as the parents list is empty when entering the action method?
Im not sure if this is a conversation issue, since the parent entity is there, just some of the properties are gone. Setting lazy-loading to false does'nt change a bit:(
Am I missing something important out on the mappings?