Hibernate version: 3.2.1.GA
Mapping document:
Code:
<hibernate-mapping>
<joined-subclass abstract="true"
name="GeographicEntity"
extends="Entity"
table="GEOGRAPHIC_ENTITY">
<key column="ID_ENTITY" not-null="true" />
<set name="subparts" table="NESTED_ENTITIES"
cascade="save-update, merge, delete" sort="EntityComparator">
<key column="ID_ENTITY" />
<many-to-many column="ID_CONTAINED_ENTITY"
entity-name="GeographicEntity">
</many-to-many>
</set>
</joined-subclass>
</hibernate-mapping>
Database: Oracle
It's a composite, a GeographicEntity can have multiple GeographicEntity childs, and multiple parents, so I'm mapping only the childs (I don't really need parents).
The problem comes when adding elements to the "GeographicEntity" object (subparts). They don't get saved in the many to many table ("NESTED_ENTITIES"), no SQL is generated, I use saveOrUpdate and checked that the geographicEntity has the new elements in the "subparts" collection, but the new relationships never get saved to the database.
Thanks in advance!