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
Member
Hi,
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"
discriminator-value="base.ItemScheme">
<meta attribute="eclassName">ItemScheme</meta>
<meta attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
<list name="Item" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`itemscheme_item_urn`" not-null="false" unique="false"/>
</key>
<list-index column="`itemscheme_item_idx`"/>
<one-to-many entity-name="base.Item"/>
</list>
</subclass>

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.

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


Current Time: Mon Jan 25 15:03:26 GMT 2021

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

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

Back to the top