Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Using ChangeRecorder and persisting ChangeDescription models
[Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052861] Tue, 30 April 2013 18:34 Go to next message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,

I'm trying to persist a ChangeDescription model into the database, but I get an error:

Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be cast to org.eclipse.emf.ecore.EObject
	at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
	at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
	at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
	at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
...
	at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)


While searching the forum, I have found that this problem has been reported and investigated some time ago here: http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542

However, from the post, it's not clear what needs to be done in order to fix the issue.

I found interesting as well the following item:
Quote:

Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
added a new custom type to Teneo:
org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e


But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?

Thanks in advance for any hints!

Best regards,
Cristian.
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052886 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052887 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052888 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052889 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052890 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052891 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052892 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052893 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052894 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052895 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052896 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052897 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052898 is a reply to message #1052861] Wed, 01 May 2013 04:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Good that you found this older post. For your reference this is the email I sent to the poster at that time. Also
attached the example project which shows how teneo can be configured to store change descriptions. Indeed you need to
add annotations to tell teneo to persist the references to the ecore model model. This is shown in the example project
in the persistence.xml file in src directory.
I have not tested it with the latest teneo version. But let me know if you encounter an issue.

gr. Martin

Email snippet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi Markus,
I solved the issue by persisting references to estructuralfeatures in a different way. See the post in the newsgroup for
more information.
I have added the library.xsd project as I have used it. Actually the only changes/new things are in the two files
directly in the src directory:
Test.java which contains a small test program
featurechange.persistence.xml which changes the way the references to efeatures are persisted

Because of this change it is not required to add the EcorePackage to the datastore (see the test case) this makes the
database schema a lot leaner.

I will do a build later today which contains the new custom user type.

gr. Martin

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 04/30/2013 08:34 PM, Cristian Mising name wrote:
> Hello,
>
> I'm trying to persist a ChangeDescription model into the database, but I get an error:
>
>
> Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.util.EObjectContainmentEList cannot be
> cast to org.eclipse.emf.ecore.EObject
> at org.eclipse.emf.teneo.hibernate.mapping.property.EReferencePropertyHandler.get(EReferencePropertyHandler.java:119)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:627)
> at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:4263)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
> ...
> at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658)
>
>
> While searching the forum, I have found that this problem has been reported and investigated some time ago here:
> http://www.eclipse.org/forums/index.php/mv/msg/135875/427542/#msg_427542
>
> However, from the post, it's not clear what needs to be done in order to fix the issue.
>
> I found interesting as well the following item:
> Quote:
>> Therefore I have implemented a new feature which allows EReferences to be persisted as custom hibernate types. I have
>> added a new custom type to Teneo:
>> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
>
> But it's not very clear if this is automatic or if I need to customize something (e.g. add mapping annotations)?
>
> Thanks in advance for any hints!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1052913 is a reply to message #1052861] Wed, 01 May 2013 10:06 Go to previous messageGo to next message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Hello Martin,

Thank you for your reply. It was helpful, and the example you provided works. Now I started to test several scenarios of the ChangeRecorder, to make sure it works as expected; I think I have to modify a little bit the logic of the ChangeRecorder, in order to work correctly with the HibernateResource. If my work is successful, I would like to contribute it to Teneo.

I have an issue that I think is related to an incorrect override of the mapping.

The original/source issue that I have now is the following: when I apply a ChangeDescription (i.e. a ChangeDescription that contains the modification of a string attribute), besides reverting the initial attribute value, there is another side effect: the changed object is deleted from the database. I think that this is due to the following line in the ChangeDescriptionImpl.apply():
getObjectChanges().clear();


Because of the following mapping, I think the related object is cascade deleted:
...
<class name="org.eclipse.emf.ecore.change.impl.EObjectToChangesMapEntryImpl" entity-name="EObjectToChangesMapEntry" abstract="false" lazy="false" table="`eobjecttochangesmapentry`">
...
	<any id-type="long" meta-type="string" name="key" cascade="all">
		<column not-null="false" unique="false" name="`key_type`"/>
		<column not-null="false" unique="false" name="`key_id`"/>
	</any>
...


I have tried to override the mapping, with the following configuration, but probably I don't do it right, because it doesn't work (i.e. the "key" property still has "cascade=all"):

	<eclass name="EObjectToChangesMapEntry">
		<property name="key">
			<many-to-one>
				<cascade>
					NONE
				</cascade>
			</many-to-one>
		</property>
	</eclass>


Do you have some pointers for me?

Thanks!

Best regards,
Cristian.
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1053518 is a reply to message #1052913] Mon, 06 May 2013 11:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Sorry for the later reply, I did some researching in the code but afaics it should work and what you do is fine. I need
to create a testmodel/testcase for this. Can you create a bugzilla for it? Then you will get updated when this is solved.
Thanks for thinking about contributing to Teneo. If you have diffs or other concrete code can you enter a bugzilla and
attach the proposed changes/diff?

gr. Martin

On 05/01/2013 12:06 PM, Cristian Mising name wrote:
> Hello Martin,
>
> Thank you for your reply. It was helpful, and the example you provided works. Now I started to test several scenarios of
> the ChangeRecorder, to make sure it works as expected; I think I have to modify a little bit the logic of the
> ChangeRecorder, in order to work correctly with the HibernateResource. If my work is successful, I would like to
> contribute it to Teneo.
>
> I have an issue that I think is related to an incorrect override of the mapping.
>
> The original/source issue that I have now is the following: when I apply a ChangeDescription (i.e. a ChangeDescription
> that contains the modification of a string attribute), besides reverting the initial attribute value, there is another
> side effect: the changed object is deleted from the database. I think that this is due to the following line in the
> ChangeDescriptionImpl.apply():
>
> getObjectChanges().clear();
>
>
> Because of the following mapping, I think the related object is cascade deleted:
>
> ...
> <class name="org.eclipse.emf.ecore.change.impl.EObjectToChangesMapEntryImpl" entity-name="EObjectToChangesMapEntry"
> abstract="false" lazy="false" table="`eobjecttochangesmapentry`">
> ...
> <any id-type="long" meta-type="string" name="key" cascade="all">
> <column not-null="false" unique="false" name="`key_type`"/>
> <column not-null="false" unique="false" name="`key_id`"/>
> </any>
> ...
>
>
> I have tried to override the mapping, with the following configuration, but probably I don't do it right, because it
> doesn't work (i.e. the "key" property still has "cascade=all"):
>
>
> <eclass name="EObjectToChangesMapEntry">
> <property name="key">
> <many-to-one>
> <cascade>
> NONE
> </cascade>
> </many-to-one>
> </property>
> </eclass>
>
>
> Do you have some pointers for me?
>
> Thanks!
>
> Best regards,
> Cristian.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Using ChangeRecorder and persisting ChangeDescription models [message #1053585 is a reply to message #1053518] Mon, 06 May 2013 15:34 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Will take a look at it shortly, I created a bugzilla for the issue that the annotation was ignored:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=407309

gr. Martin

On 05/06/2013 01:09 PM, Martin Taal wrote:
> Hi Cristian,
> Sorry for the later reply, I did some researching in the code but afaics it should work and what you do is fine. I need
> to create a testmodel/testcase for this. Can you create a bugzilla for it? Then you will get updated when this is solved.
> Thanks for thinking about contributing to Teneo. If you have diffs or other concrete code can you enter a bugzilla and
> attach the proposed changes/diff?
>
> gr. Martin
>
> On 05/01/2013 12:06 PM, Cristian Mising name wrote:
>> Hello Martin,
>>
>> Thank you for your reply. It was helpful, and the example you provided works. Now I started to test several scenarios of
>> the ChangeRecorder, to make sure it works as expected; I think I have to modify a little bit the logic of the
>> ChangeRecorder, in order to work correctly with the HibernateResource. If my work is successful, I would like to
>> contribute it to Teneo.
>>
>> I have an issue that I think is related to an incorrect override of the mapping.
>>
>> The original/source issue that I have now is the following: when I apply a ChangeDescription (i.e. a ChangeDescription
>> that contains the modification of a string attribute), besides reverting the initial attribute value, there is another
>> side effect: the changed object is deleted from the database. I think that this is due to the following line in the
>> ChangeDescriptionImpl.apply():
>>
>> getObjectChanges().clear();
>>
>>
>> Because of the following mapping, I think the related object is cascade deleted:
>>
>> ...
>> <class name="org.eclipse.emf.ecore.change.impl.EObjectToChangesMapEntryImpl" entity-name="EObjectToChangesMapEntry"
>> abstract="false" lazy="false" table="`eobjecttochangesmapentry`">
>> ...
>> <any id-type="long" meta-type="string" name="key" cascade="all">
>> <column not-null="false" unique="false" name="`key_type`"/>
>> <column not-null="false" unique="false" name="`key_id`"/>
>> </any>
>> ...
>>
>>
>> I have tried to override the mapping, with the following configuration, but probably I don't do it right, because it
>> doesn't work (i.e. the "key" property still has "cascade=all"):
>>
>>
>> <eclass name="EObjectToChangesMapEntry">
>> <property name="key">
>> <many-to-one>
>> <cascade>
>> NONE
>> </cascade>
>> </many-to-one>
>> </property>
>> </eclass>
>>
>>
>> Do you have some pointers for me?
>>
>> Thanks!
>>
>> Best regards,
>> Cristian.
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:EContentAdapter does not always see map values changes
Next Topic:Class Cast exception thrown for an EMap during model instantiation
Goto Forum:
  


Current Time: Fri Apr 19 00:32:32 GMT 2024

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

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

Back to the top