-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate,OSIV,Spring, JSF: Properties missing after request
PostPosted: Wed Sep 24, 2008 4:07 pm 
Newbie

Joined: Wed Sep 24, 2008 3:34 pm
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.