|[Teneo] Child objects in DB have multiple references to parent. [message #607005]
||Mon, 18 June 2007 11:40
| Duncan Alexander
Registered: July 2009
I noticed that Teneo generates multiple columns for references between a child and parent in a
one-to-many relationship. I can understand what each of them represents but wonder why they both
must exist independently and I think it is causing my orphan objects to not be deleted.
For example, I have an object called ItemScheme which contains Items in a list.
The mapping looks like:
<subclass entity-name="base.ItemScheme" abstract="true" lazy="false" extends="base.Maintainable"
<list name="Item" lazy="true" cascade="all,delete-orphan">
<column name="`itemscheme_item_urn`" not-null="false" unique="false"/>
And when I look at the generated columns in the DB for Items I see the itemscheme_item_urn column
which points to the parent but also an eContainer column which references the same parent.
The problem I have is that if I update my ItemScheme from a dettached object with a different set of
Items then I can correctly see my new items in the database with refernce to the ItemScheme parent.
But I can see that the old Items which are no longer referenced still exist in the database with
their itemscheme_item_urn field set to null, but the eContainer field still referencing the
ItemScheme. I would expect the Item to be removed completely under these circumstances.
Powered by FUDForum
. Page generated in 0.01617 seconds