Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Child objects in DB have multiple references to parent.
[Teneo] Child objects in DB have multiple references to parent. [message #607005] Mon, 18 June 2007 11:40
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
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"
<meta attribute="eclassName">ItemScheme</meta>
<meta attribute="epackage"></meta>
<list name="Item" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`itemscheme_item_urn`" not-null="false" unique="false"/>
<list-index column="`itemscheme_item_idx`"/>
<one-to-many entity-name="base.Item"/>

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.

Previous Topic:[Teneo] : VersionPropertyHandler returns null for dettached objects
Next Topic:EMF Compare - Diffing EMF UML2 XMI
Goto Forum:

Current Time: Wed Dec 07 00:53:17 GMT 2022

Powered by FUDForum. Page generated in 0.02001 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top