HI,
I have a problem with update my persistence Object. In the Object is a
list with REF_PROJEKT_ENTITY-Objects. When I change values in same REF_PROJEKT_ENTITY-Objects or take a new
to the list, the update will work fine and I can see the canges in the database. But if I remove one REF_PROJEKT_ENTITY-object from
the list, the value are not delete in the
database?
What is wrong?
Claudia
Hibernate version: 2
Mapping documents:
Code:
<class name="Projekt" table="DATA_PROJEKT">
<id name="projekt_id" type="java.lang.Long">
<column name="PROJEKT_ID" sql-type="number" not-null="true" />
<generator class="sequence">
<param name="sequence">SEQ_DATA_PROJEKT</param>
</generator>
</id>
<property name="name" type="string">
<column name="NAME" sql-type="VARCHAR(100)" />
</property>
<property name="info" type="string">
<column name="INFO" sql-type="VARCHAR(100)" />
</property>
<list name="projektDDE" table="REF_PROJEKT_ENTITY" inverse="true" cascade="all">
<key column="projekt_id"/>
<index column="projekt_entity_id"/>
<one-to-many class="RefProjektEntity" />
</list>
</class>
Code between sessionFactory.openSession() and session.close():Code:
Transaction tx=null;
session =this.getSession();
tx=session.beginTransaction();
Projekt p=buchung.getProkekt();
session.saveOrUpdate(p);
session.flush();
tx.commit();
Name and version of the database you are using:Oracle 8
The generated SQL (show_sql=true):[code]Hibernate: select this.PROJEKT_ID as PROJEKT_ID0_, this.NAME as NAME0_, this.INFO as INFO0_, this.OWNER_USER_ID as OWNER_US4_0_, this.LASTUPDATE as LASTUPDATE0_ from DATA_PROJEKT this where this.PROJEKT_ID=?
Hibernate: select projektdde0_.PROJEKT_ENTITY_ID as PROJEKT_1___, projektdde0_.projekt_id as projekt_id__, projektdde0_.projekt_entity_id as projekt_8___, projektdde0_.PROJEKT_ENTITY_ID as PROJEKT_1_1_, projektdde0_.INFO as INFO1_, projektdde0_.VARIANTE as VARIANTE1_, projektdde0_.entity_id as entity_id1_, projektdde0_.Projekt_ID as Projekt_ID1_, projektdde0_.LASTUPDATE as LASTUPDATE1_, entity1_.ENTITY_ID as ENTITY_ID0_, entity1_.BESCHREIBUNG as BESCHREI2_0_, entity1_.DDE as DDE0_, entity1_.NAME as NAME0_, entity1_.JAHR as JAHR0_ from REF_PROJEKT_ENTITY projektdde0_, kat_entity entity1_ where projektdde0_.projekt_id=? and projektdde0_.entity_id=entity1_.ENTITY_ID(+)
Hibernate: select items0_.JAHR as JAHR__, items0_.item_id as item_id__, items0_.art_id as art_id__, items0_.entity_id as entity_id__, items0_.ref_entity_item_id as ref_enti5___, item1_.ITEM_ID as ITEM_ID0_, item1_.DDI as DDI0_, item1_.NAME as NAME0_, item1_.L