Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] IdentifierCacheHandler does not work for EObjects with hashCode implementations
[Teneo] IdentifierCacheHandler does not work for EObjects with hashCode implementations [message #602294] Wed, 07 February 2007 18:32
Michael Kanaley is currently offline Michael KanaleyFriend
Messages: 89
Registered: July 2009
I've run into a problem with Teneo.
Some of my EObjects implement hashCode/equals using the properties stored in
the EObject.
It appears that Teneo updates the IdentifierCacheHandler.idMap before any of
the properties are set. The Key inserted into the idMap has a hashCode for
an "empty" object. Once all the properties are set and Hibernate is
retrieving the identity to see if it has changed, the Key used will not map
to the original one since all the properties have been set. This leads to an
exception similar to the following:
org.hibernate.HibernateException: identifier of an instance of
SomeModelObjectClass was altered from 1 to null
org.hibernate.event.def.DefaultFlushEntityEventListener.chec kId(
org.hibernate.event.def.DefaultFlushEntityEventListener.getV alues(
org.hibernate.event.def.DefaultFlushEntityEventListener.onFl ushEntity(
org.hibernate.event.def.AbstractFlushingEventListener.flushE ntities(
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(
at org.hibernate.impl.SessionImpl.flush(
at org.hibernate.impl.SessionImpl.managedFlush( :338)

Is there any way to get around this issue without removing the
hashCode/equals implementations in my EObjects?
Previous Topic:For those using Teneo from cvs: HEAD is Teneo for EMF 2.3 , Branch: R0_7_maintenance is EMF 2.2
Next Topic:[Teneo] Setting a "unique-key" attribute on a many-to-one association using Eannotations w
Goto Forum:

Current Time: Tue Oct 20 12:54:32 GMT 2020

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

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

Back to the top