Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2.2
Mapping documents:
<hibernate-mapping>
<class name="ch.rtc.tech.test.BaDbs_Person" table="PERSON">
...
<version name="version"
<column name="version"/>
</version>
<set name="adressen" inverse="true" cascade="all" order-by="ort asc">
<key column="FK_PERSON"/>
<one-to-many class="ch.rtc.tech.test.BaDbs_Adresse"/>
</set>
...
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
BaDbs_Person person2 = (BaDbs_Person) session.get(BaDbs_Person.class, key);
assertEquals(3, person2.getAdressen().size());
BaDbs_Adresse adr = createAdresse(test, id, 4);
person2.addAdresse(adr);
Full stack trace of any exception that occurs:
no exception
Name and version of the database you are using:
hsqldb 1.8.0
i have a PreUpdateListener configured for the session factory.
when adding a new child (BaDbs_Adresse) to the parent a PreUpdateEvent is fired for the parent as expected. When i inspect the state/oldState of the event both contain the same instance of the child collection. The collection already contains the newly added child.
is this a bug in the event ?
it looks like if the event is only fired because of the changed 'version' attribute. see also
http://opensource.atlassian.com/project ... e/HHH-2616
thanks
jakob