Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] ClassCastException from hibernate trying to persist a new EMap entry.
[Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #88071] Thu, 05 July 2007 05:19 Go to next message
Eclipse UserFriend
Originally posted by: eclipsenews.cs-guy.com

I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019) from
Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error during
regression testing of my project.

I have an EMF model that includes the following classes:

<eClassifiers xsi:type="ecore:EEnum" name="Type">
<eLiterals name="Started" literal="STARTED"/>
<eLiterals name="Stopped" value="1" literal="STOPPED"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Event"
instanceClassName="java.util.Map$Entry">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
lowerBound="1"
eType="#//playtimehistory/Type"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
lowerBound="1"
eType="#//DateTime"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
lowerBound="1" eType="#//DateTime"
volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
lowerBound="1"
eType="#//playtimehistory/Type" volatile="true" transient="true"
derived="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
<eStructuralFeatures xsi:type="ecore:EReference" name="events"
upperBound="-1"
eType="#//playtimehistory/Event" containment="true"
eKeys="#//playtimehistory/Event/time"/>
</eClassifiers>

My code lets Teneo use an in-memory Hibernate mapping. A mapping file
generated using the Teneo context menu on my Ecore file contains the
following relevant sections (with some java base packages and URLs edited
for privacy reasons):

<class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
abstract="false" lazy="false" discriminator-value="Event" table="`event`">
<meta attribute="eclassName">Event</meta>
<meta attribute="epackage">http://PlaytimeHistory</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<property name="type" lazy="false" not-null="true" insert="true"
update="true" unique="false">
<column not-null="true" unique="false" name="`type`"/>
<type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
<param name="enumClass">model.playtimehistory.Type</param>
</type>
</property>
<property name="time" lazy="false" insert="true" update="true"
not-null="true" unique="false" type="model.DateTime">
<column not-null="true" unique="false" name="`time`"/>
</property>
</class>
<class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
entity-name="PlaytimeHistory" abstract="false" lazy="false"
discriminator-value="PlaytimeHistory" table="`playtimehistory`">
<meta attribute="eclassName">PlaytimeHistory</meta>
<meta attribute="epackage">http://PlaytimeHistory</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<list name="events" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`playtimehistory_events_e_id`" not-null="false"
unique="false"/>
</key>
<list-index column="`playtimehistory_events_idx`"/>
<one-to-many entity-name="Event"/>
</list>
</class>

In short I have a class with a member of type "EMap<DateTime, Type>" named
"events" that gets mapped to a "list" in Hibernate. When my application
adds an entry to the map and saves the model (using a Hibernate EMF
Resource) I get a ClassCastException from deep in the bowels of Hibernate (v
3.2.3ga). Hibernate is trying to cast a BasicEMap$DelegatingMap to a
java.lang.Collection. Here's the stack trace:

java.lang.ClassCastException:
org.eclipse.emf.common.util.BasicEMap$DelegatingMap
at
org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
at
org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
at
org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
at
org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at
org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
at org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at
org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at
org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)

This code was working fine on the previous versions of the tool chain. Any
ideas what is broken? Is it my model, Teneo, or Hibernate?

Thanks,
Chris
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #88088 is a reply to message #88071] Thu, 05 July 2007 08:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I think it is related to the setting of the option: PersistenceOptions.EMAP_AS_TRUE_MAP. However it
should work with both true and false if you let Teneo create the mapping automatically.
Can you show me the relevant part of the in-memory mapping (do datastore.getMappingXML())?

gr. Martin

Chris Hines wrote:
> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019) from
> Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error during
> regression testing of my project.
>
> I have an EMF model that includes the following classes:
>
> <eClassifiers xsi:type="ecore:EEnum" name="Type">
> <eLiterals name="Started" literal="STARTED"/>
> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Event"
> instanceClassName="java.util.Map$Entry">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
> lowerBound="1"
> eType="#//playtimehistory/Type"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
> lowerBound="1"
> eType="#//DateTime"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
> lowerBound="1" eType="#//DateTime"
> volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
> lowerBound="1"
> eType="#//playtimehistory/Type" volatile="true" transient="true"
> derived="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
> upperBound="-1"
> eType="#//playtimehistory/Event" containment="true"
> eKeys="#//playtimehistory/Event/time"/>
> </eClassifiers>
>
> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
> generated using the Teneo context menu on my Ecore file contains the
> following relevant sections (with some java base packages and URLs edited
> for privacy reasons):
>
> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
> abstract="false" lazy="false" discriminator-value="Event" table="`event`">
> <meta attribute="eclassName">Event</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <property name="type" lazy="false" not-null="true" insert="true"
> update="true" unique="false">
> <column not-null="true" unique="false" name="`type`"/>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
> <param name="enumClass">model.playtimehistory.Type</param>
> </type>
> </property>
> <property name="time" lazy="false" insert="true" update="true"
> not-null="true" unique="false" type="model.DateTime">
> <column not-null="true" unique="false" name="`time`"/>
> </property>
> </class>
> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
> entity-name="PlaytimeHistory" abstract="false" lazy="false"
> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
> <meta attribute="eclassName">PlaytimeHistory</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <list name="events" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`playtimehistory_events_e_id`" not-null="false"
> unique="false"/>
> </key>
> <list-index column="`playtimehistory_events_idx`"/>
> <one-to-many entity-name="Event"/>
> </list>
> </class>
>
> In short I have a class with a member of type "EMap<DateTime, Type>" named
> "events" that gets mapped to a "list" in Hibernate. When my application
> adds an entry to the map and saves the model (using a Hibernate EMF
> Resource) I get a ClassCastException from deep in the bowels of Hibernate (v
> 3.2.3ga). Hibernate is trying to cast a BasicEMap$DelegatingMap to a
> java.lang.Collection. Here's the stack trace:
>
> java.lang.ClassCastException:
> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
> at
> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
> at
> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
> at
> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
> at
> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
> at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
> at
> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
> at
> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
> at
> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
> at
> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
> at org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>
> This code was working fine on the previous versions of the tool chain. Any
> ideas what is broken? Is it my model, Teneo, or Hibernate?
>
> Thanks,
> Chris
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #88342 is a reply to message #88088] Thu, 05 July 2007 22:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipsenews.cs-guy.com

Martin,

Thanks for the quick response.

The in-memory mapping is identical to the one I sent before according to an
automated comparison. Nontheless, here is the relevant part of the
in-memory mapping.

<class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
abstract="false" lazy="false" discriminator-value="Event" table="`event`">
<meta attribute="eclassName">Event</meta>
<meta attribute="epackage">http://PlaytimeHistory</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<property name="type" lazy="false" not-null="true" insert="true"
update="true" unique="false">
<column not-null="true" unique="false" name="`type`"/>
<type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
<param name="enumClass">model.playtimehistory.Type</param>
</type>
</property>
<property name="time" lazy="false" insert="true" update="true"
not-null="true" unique="false" type="model.DateTime">
<column not-null="true" unique="false" name="`time`"/>
</property>
</class>
<class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
entity-name="PlaytimeHistory" abstract="false" lazy="false"
discriminator-value="PlaytimeHistory" table="`playtimehistory`">
<meta attribute="eclassName">PlaytimeHistory</meta>
<meta attribute="epackage">http://PlaytimeHistory</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<list name="events" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`playtimehistory_events_e_id`" not-null="false"
unique="false"/>
</key>
<list-index column="`playtimehistory_events_idx`"/>
<one-to-many entity-name="Event"/>
</list>
</class>

Thanks,
Chris

"Martin Taal" <mtaal@elver.org> wrote in message
news:f6i8jl$37u$1@build.eclipse.org...
>I think it is related to the setting of the option:
>PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both true
>and false if you let Teneo create the mapping automatically.
> Can you show me the relevant part of the in-memory mapping (do
> datastore.getMappingXML())?
>
> gr. Martin
>
> Chris Hines wrote:
>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>> during regression testing of my project.
>>
>> I have an EMF model that includes the following classes:
>>
>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>> <eLiterals name="Started" literal="STARTED"/>
>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>> instanceClassName="java.util.Map$Entry">
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>> lowerBound="1"
>> eType="#//playtimehistory/Type"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>> lowerBound="1"
>> eType="#//DateTime"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>> lowerBound="1" eType="#//DateTime"
>> volatile="true" transient="true" derived="true"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>> lowerBound="1"
>> eType="#//playtimehistory/Type" volatile="true"
>> transient="true" derived="true"/>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>> upperBound="-1"
>> eType="#//playtimehistory/Event" containment="true"
>> eKeys="#//playtimehistory/Event/time"/>
>> </eClassifiers>
>>
>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>> generated using the Teneo context menu on my Ecore file contains the
>> following relevant sections (with some java base packages and URLs edited
>> for privacy reasons):
>>
>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>> abstract="false" lazy="false" discriminator-value="Event"
>> table="`event`">
>> <meta attribute="eclassName">Event</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <property name="type" lazy="false" not-null="true" insert="true"
>> update="true" unique="false">
>> <column not-null="true" unique="false" name="`type`"/>
>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>> <param name="enumClass">model.playtimehistory.Type</param>
>> </type>
>> </property>
>> <property name="time" lazy="false" insert="true" update="true"
>> not-null="true" unique="false" type="model.DateTime">
>> <column not-null="true" unique="false" name="`time`"/>
>> </property>
>> </class>
>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>> <meta attribute="eclassName">PlaytimeHistory</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <list name="events" lazy="true" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`playtimehistory_events_e_id`" not-null="false"
>> unique="false"/>
>> </key>
>> <list-index column="`playtimehistory_events_idx`"/>
>> <one-to-many entity-name="Event"/>
>> </list>
>> </class>
>>
>> In short I have a class with a member of type "EMap<DateTime, Type>"
>> named "events" that gets mapped to a "list" in Hibernate. When my
>> application adds an entry to the map and saves the model (using a
>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>> trace:
>>
>> java.lang.ClassCastException:
>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>> at
>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>> at
>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>> at
>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>> at
>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>> at
>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>> at
>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>> at
>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>> at
>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>> at
>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>
>> This code was working fine on the previous versions of the tool chain.
>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>
>> Thanks,
>> Chris
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Tel: +31 (0)84 420 2397
> Fax: +31 (0)84 225 9307
> Mail: mtaal@springsite.com - mtaal@elver.org
> Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #88609 is a reply to message #88342] Sun, 08 July 2007 22:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Chris,
I tried to reproduce this but I can't. I still think that this is related to the option:
EMAP_AS_TRUE_MAP. To what value do you set this option?
To be sure, the hbm you show below, is the one which goes wrong?
Can you make a small testcase which reproduces this?

gr. martin

Chris Hines wrote:
> Martin,
>
> Thanks for the quick response.
>
> The in-memory mapping is identical to the one I sent before according to an
> automated comparison. Nontheless, here is the relevant part of the
> in-memory mapping.
>
> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
> abstract="false" lazy="false" discriminator-value="Event" table="`event`">
> <meta attribute="eclassName">Event</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <property name="type" lazy="false" not-null="true" insert="true"
> update="true" unique="false">
> <column not-null="true" unique="false" name="`type`"/>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
> <param name="enumClass">model.playtimehistory.Type</param>
> </type>
> </property>
> <property name="time" lazy="false" insert="true" update="true"
> not-null="true" unique="false" type="model.DateTime">
> <column not-null="true" unique="false" name="`time`"/>
> </property>
> </class>
> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
> entity-name="PlaytimeHistory" abstract="false" lazy="false"
> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
> <meta attribute="eclassName">PlaytimeHistory</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <list name="events" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`playtimehistory_events_e_id`" not-null="false"
> unique="false"/>
> </key>
> <list-index column="`playtimehistory_events_idx`"/>
> <one-to-many entity-name="Event"/>
> </list>
> </class>
>
> Thanks,
> Chris
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f6i8jl$37u$1@build.eclipse.org...
>> I think it is related to the setting of the option:
>> PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both true
>> and false if you let Teneo create the mapping automatically.
>> Can you show me the relevant part of the in-memory mapping (do
>> datastore.getMappingXML())?
>>
>> gr. Martin
>>
>> Chris Hines wrote:
>>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>>> during regression testing of my project.
>>>
>>> I have an EMF model that includes the following classes:
>>>
>>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>>> <eLiterals name="Started" literal="STARTED"/>
>>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>>> </eClassifiers>
>>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>>> instanceClassName="java.util.Map$Entry">
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>>> lowerBound="1"
>>> eType="#//playtimehistory/Type"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>>> lowerBound="1"
>>> eType="#//DateTime"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>> lowerBound="1" eType="#//DateTime"
>>> volatile="true" transient="true" derived="true"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>> lowerBound="1"
>>> eType="#//playtimehistory/Type" volatile="true"
>>> transient="true" derived="true"/>
>>> </eClassifiers>
>>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>>> upperBound="-1"
>>> eType="#//playtimehistory/Event" containment="true"
>>> eKeys="#//playtimehistory/Event/time"/>
>>> </eClassifiers>
>>>
>>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>>> generated using the Teneo context menu on my Ecore file contains the
>>> following relevant sections (with some java base packages and URLs edited
>>> for privacy reasons):
>>>
>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>> abstract="false" lazy="false" discriminator-value="Event"
>>> table="`event`">
>>> <meta attribute="eclassName">Event</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <property name="type" lazy="false" not-null="true" insert="true"
>>> update="true" unique="false">
>>> <column not-null="true" unique="false" name="`type`"/>
>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>> <param name="enumClass">model.playtimehistory.Type</param>
>>> </type>
>>> </property>
>>> <property name="time" lazy="false" insert="true" update="true"
>>> not-null="true" unique="false" type="model.DateTime">
>>> <column not-null="true" unique="false" name="`time`"/>
>>> </property>
>>> </class>
>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>> <key update="true">
>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>> unique="false"/>
>>> </key>
>>> <list-index column="`playtimehistory_events_idx`"/>
>>> <one-to-many entity-name="Event"/>
>>> </list>
>>> </class>
>>>
>>> In short I have a class with a member of type "EMap<DateTime, Type>"
>>> named "events" that gets mapped to a "list" in Hibernate. When my
>>> application adds an entry to the map and saves the model (using a
>>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>>> trace:
>>>
>>> java.lang.ClassCastException:
>>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>>> at
>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>>> at
>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>>> at
>>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>>> at
>>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>>> at
>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>>> at
>>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>>> at
>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>>> at
>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>>
>>> This code was working fine on the previous versions of the tool chain.
>>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>>
>>> Thanks,
>>> Chris
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Tel: +31 (0)84 420 2397
>> Fax: +31 (0)84 225 9307
>> Mail: mtaal@springsite.com - mtaal@elver.org
>> Web: www.springsite.com - www.elver.org
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #88624 is a reply to message #88609] Mon, 09 July 2007 03:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipsenews.cs-guy.com

Martin,

If I call dataStore.getPersistenceOptions() after dataStore.initialize() the
return value indicates that teneo.mapping.emap_as_true_map=true.

However, since you didn't think that the value of this option should matter
in your earlier message, I decided to try something else based on a hunch I
had, and I have fixed the problem.

More detail:

If you look closely at the section of my model that I included in my
original message you will notice that my Map$Entry class named Event is a
bit unusual. It has four attributes, respectively named time, type, key,
and value. Attributes time and type are the real (non-volatile) fields, and
key and value are derived/transient/volatile fields that are implemented to
return the values of time and type respectively. I built my model this way
so that I could use domain specific getters and setters when manipulating
the model while also satisfying EMF's desire to have key and value fields
for its maps.

My hunch was that perhaps this unusual Map$Entry class definition was
causing Teneo some problems. My hunch appears to be correct. I removed the
time and type attributes from my model and converted the key and value to
concrete attributes. After regenerating my code Teneo now produces the
following mapping XML for the event class:

<map name="events" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`playtimehistory_events_e_id`" not-null="false"
unique="false"/>
</key>
<map-key type="model.DateTime"/>
<element>
<type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
<param name="enumClass">model.playtimehistory.Type</param>
</type>
</element>
</map>

And more important, my data is properly persisted.

It is curious, however, that the original model worked with Teneo 0.7.5, but
was broken with Teneo 0.8. I'm not sure if this was on purpose. Perhaps it
is something you care enough to look into.

For my part, I can live with the more abstract key and value fields if it
means my code works.

Thanks for your time and effort looking into this.

Chris

"Martin Taal" <mtaal@elver.org> wrote in message
news:f6rnbe$dvi$1@build.eclipse.org...
> Chris,
> I tried to reproduce this but I can't. I still think that this is related
> to the option: EMAP_AS_TRUE_MAP. To what value do you set this option?
> To be sure, the hbm you show below, is the one which goes wrong?
> Can you make a small testcase which reproduces this?
>
> gr. martin
>
> Chris Hines wrote:
>> Martin,
>>
>> Thanks for the quick response.
>>
>> The in-memory mapping is identical to the one I sent before according to
>> an automated comparison. Nontheless, here is the relevant part of the
>> in-memory mapping.
>>
>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>> abstract="false" lazy="false" discriminator-value="Event"
>> table="`event`">
>> <meta attribute="eclassName">Event</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <property name="type" lazy="false" not-null="true" insert="true"
>> update="true" unique="false">
>> <column not-null="true" unique="false" name="`type`"/>
>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>> <param name="enumClass">model.playtimehistory.Type</param>
>> </type>
>> </property>
>> <property name="time" lazy="false" insert="true" update="true"
>> not-null="true" unique="false" type="model.DateTime">
>> <column not-null="true" unique="false" name="`time`"/>
>> </property>
>> </class>
>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>> <meta attribute="eclassName">PlaytimeHistory</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <list name="events" lazy="true" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`playtimehistory_events_e_id`" not-null="false"
>> unique="false"/>
>> </key>
>> <list-index column="`playtimehistory_events_idx`"/>
>> <one-to-many entity-name="Event"/>
>> </list>
>> </class>
>>
>> Thanks,
>> Chris
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:f6i8jl$37u$1@build.eclipse.org...
>>> I think it is related to the setting of the option:
>>> PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both
>>> true and false if you let Teneo create the mapping automatically.
>>> Can you show me the relevant part of the in-memory mapping (do
>>> datastore.getMappingXML())?
>>>
>>> gr. Martin
>>>
>>> Chris Hines wrote:
>>>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>>>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>>>> during regression testing of my project.
>>>>
>>>> I have an EMF model that includes the following classes:
>>>>
>>>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>>>> <eLiterals name="Started" literal="STARTED"/>
>>>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>>>> </eClassifiers>
>>>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>>>> instanceClassName="java.util.Map$Entry">
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>>>> lowerBound="1"
>>>> eType="#//playtimehistory/Type"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>>>> lowerBound="1"
>>>> eType="#//DateTime"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>> lowerBound="1" eType="#//DateTime"
>>>> volatile="true" transient="true" derived="true"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>> lowerBound="1"
>>>> eType="#//playtimehistory/Type" volatile="true"
>>>> transient="true" derived="true"/>
>>>> </eClassifiers>
>>>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>>>> upperBound="-1"
>>>> eType="#//playtimehistory/Event" containment="true"
>>>> eKeys="#//playtimehistory/Event/time"/>
>>>> </eClassifiers>
>>>>
>>>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>>>> generated using the Teneo context menu on my Ecore file contains the
>>>> following relevant sections (with some java base packages and URLs
>>>> edited for privacy reasons):
>>>>
>>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>>> abstract="false" lazy="false" discriminator-value="Event"
>>>> table="`event`">
>>>> <meta attribute="eclassName">Event</meta>
>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>> <id type="long" name="e_id" column="e_id"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>> <meta attribute="syntheticId">true</meta>
>>>> <generator class="native"/>
>>>> </id>
>>>> <discriminator column="`dtype`" type="string"/>
>>>> <version name="e_version" column="e_version"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>> <meta attribute="syntheticVersion">true</meta>
>>>> </version>
>>>> <property name="type" lazy="false" not-null="true" insert="true"
>>>> update="true" unique="false">
>>>> <column not-null="true" unique="false" name="`type`"/>
>>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>>> <param name="enumClass">model.playtimehistory.Type</param>
>>>> </type>
>>>> </property>
>>>> <property name="time" lazy="false" insert="true" update="true"
>>>> not-null="true" unique="false" type="model.DateTime">
>>>> <column not-null="true" unique="false" name="`time`"/>
>>>> </property>
>>>> </class>
>>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>> <id type="long" name="e_id" column="e_id"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>> <meta attribute="syntheticId">true</meta>
>>>> <generator class="native"/>
>>>> </id>
>>>> <discriminator column="`dtype`" type="string"/>
>>>> <version name="e_version" column="e_version"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>> <meta attribute="syntheticVersion">true</meta>
>>>> </version>
>>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>>> <key update="true">
>>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>>> unique="false"/>
>>>> </key>
>>>> <list-index column="`playtimehistory_events_idx`"/>
>>>> <one-to-many entity-name="Event"/>
>>>> </list>
>>>> </class>
>>>>
>>>> In short I have a class with a member of type "EMap<DateTime, Type>"
>>>> named "events" that gets mapped to a "list" in Hibernate. When my
>>>> application adds an entry to the map and saves the model (using a
>>>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>>>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>>>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>>>> trace:
>>>>
>>>> java.lang.ClassCastException:
>>>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>>>> at
>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>>>> at
>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>>>> at
>>>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>>>> at
>>>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>>>> at
>>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>> at
>>>> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>>>> at
>>>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>> at
>>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>>>> at
>>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>>>> at
>>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>>>> at
>>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>>>
>>>> This code was working fine on the previous versions of the tool chain.
>>>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>>>
>>>> Thanks,
>>>> Chris
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> Tel: +31 (0)84 420 2397
>>> Fax: +31 (0)84 225 9307
>>> Mail: mtaal@springsite.com - mtaal@elver.org
>>> Web: www.springsite.com - www.elver.org
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Tel: +31 (0)84 420 2397
> Fax: +31 (0)84 225 9307
> Mail: mtaal@springsite.com - mtaal@elver.org
> Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #88640 is a reply to message #88624] Mon, 09 July 2007 07:13 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Chris,
Thanks for the update. It seems that looking at the previous mapping that
teneo.mapping.emap_as_true_map was false (as the map was mapped as a list). So that's what I looked
at most. I hadn't noticed that the key/value eattributes were volatile/transient. I will try this
out later.

gr. Maritn

Chris Hines wrote:
> Martin,
>
> If I call dataStore.getPersistenceOptions() after dataStore.initialize() the
> return value indicates that teneo.mapping.emap_as_true_map=true.
>
> However, since you didn't think that the value of this option should matter
> in your earlier message, I decided to try something else based on a hunch I
> had, and I have fixed the problem.
>
> More detail:
>
> If you look closely at the section of my model that I included in my
> original message you will notice that my Map$Entry class named Event is a
> bit unusual. It has four attributes, respectively named time, type, key,
> and value. Attributes time and type are the real (non-volatile) fields, and
> key and value are derived/transient/volatile fields that are implemented to
> return the values of time and type respectively. I built my model this way
> so that I could use domain specific getters and setters when manipulating
> the model while also satisfying EMF's desire to have key and value fields
> for its maps.
>
> My hunch was that perhaps this unusual Map$Entry class definition was
> causing Teneo some problems. My hunch appears to be correct. I removed the
> time and type attributes from my model and converted the key and value to
> concrete attributes. After regenerating my code Teneo now produces the
> following mapping XML for the event class:
>
> <map name="events" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`playtimehistory_events_e_id`" not-null="false"
> unique="false"/>
> </key>
> <map-key type="model.DateTime"/>
> <element>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
> <param name="enumClass">model.playtimehistory.Type</param>
> </type>
> </element>
> </map>
>
> And more important, my data is properly persisted.
>
> It is curious, however, that the original model worked with Teneo 0.7.5, but
> was broken with Teneo 0.8. I'm not sure if this was on purpose. Perhaps it
> is something you care enough to look into.
>
> For my part, I can live with the more abstract key and value fields if it
> means my code works.
>
> Thanks for your time and effort looking into this.
>
> Chris
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f6rnbe$dvi$1@build.eclipse.org...
>> Chris,
>> I tried to reproduce this but I can't. I still think that this is related
>> to the option: EMAP_AS_TRUE_MAP. To what value do you set this option?
>> To be sure, the hbm you show below, is the one which goes wrong?
>> Can you make a small testcase which reproduces this?
>>
>> gr. martin
>>
>> Chris Hines wrote:
>>> Martin,
>>>
>>> Thanks for the quick response.
>>>
>>> The in-memory mapping is identical to the one I sent before according to
>>> an automated comparison. Nontheless, here is the relevant part of the
>>> in-memory mapping.
>>>
>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>> abstract="false" lazy="false" discriminator-value="Event"
>>> table="`event`">
>>> <meta attribute="eclassName">Event</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <property name="type" lazy="false" not-null="true" insert="true"
>>> update="true" unique="false">
>>> <column not-null="true" unique="false" name="`type`"/>
>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>> <param name="enumClass">model.playtimehistory.Type</param>
>>> </type>
>>> </property>
>>> <property name="time" lazy="false" insert="true" update="true"
>>> not-null="true" unique="false" type="model.DateTime">
>>> <column not-null="true" unique="false" name="`time`"/>
>>> </property>
>>> </class>
>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>> <key update="true">
>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>> unique="false"/>
>>> </key>
>>> <list-index column="`playtimehistory_events_idx`"/>
>>> <one-to-many entity-name="Event"/>
>>> </list>
>>> </class>
>>>
>>> Thanks,
>>> Chris
>>>
>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>> news:f6i8jl$37u$1@build.eclipse.org...
>>>> I think it is related to the setting of the option:
>>>> PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both
>>>> true and false if you let Teneo create the mapping automatically.
>>>> Can you show me the relevant part of the in-memory mapping (do
>>>> datastore.getMappingXML())?
>>>>
>>>> gr. Martin
>>>>
>>>> Chris Hines wrote:
>>>>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>>>>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>>>>> during regression testing of my project.
>>>>>
>>>>> I have an EMF model that includes the following classes:
>>>>>
>>>>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>>>>> <eLiterals name="Started" literal="STARTED"/>
>>>>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>>>>> </eClassifiers>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>>>>> instanceClassName="java.util.Map$Entry">
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>>>>> lowerBound="1"
>>>>> eType="#//playtimehistory/Type"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>>>>> lowerBound="1"
>>>>> eType="#//DateTime"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>>> lowerBound="1" eType="#//DateTime"
>>>>> volatile="true" transient="true" derived="true"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>>> lowerBound="1"
>>>>> eType="#//playtimehistory/Type" volatile="true"
>>>>> transient="true" derived="true"/>
>>>>> </eClassifiers>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>>>>> upperBound="-1"
>>>>> eType="#//playtimehistory/Event" containment="true"
>>>>> eKeys="#//playtimehistory/Event/time"/>
>>>>> </eClassifiers>
>>>>>
>>>>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>>>>> generated using the Teneo context menu on my Ecore file contains the
>>>>> following relevant sections (with some java base packages and URLs
>>>>> edited for privacy reasons):
>>>>>
>>>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>>>> abstract="false" lazy="false" discriminator-value="Event"
>>>>> table="`event`">
>>>>> <meta attribute="eclassName">Event</meta>
>>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>>> <id type="long" name="e_id" column="e_id"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>>> <meta attribute="syntheticId">true</meta>
>>>>> <generator class="native"/>
>>>>> </id>
>>>>> <discriminator column="`dtype`" type="string"/>
>>>>> <version name="e_version" column="e_version"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>>> <meta attribute="syntheticVersion">true</meta>
>>>>> </version>
>>>>> <property name="type" lazy="false" not-null="true" insert="true"
>>>>> update="true" unique="false">
>>>>> <column not-null="true" unique="false" name="`type`"/>
>>>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>>>> <param name="enumClass">model.playtimehistory.Type</param>
>>>>> </type>
>>>>> </property>
>>>>> <property name="time" lazy="false" insert="true" update="true"
>>>>> not-null="true" unique="false" type="model.DateTime">
>>>>> <column not-null="true" unique="false" name="`time`"/>
>>>>> </property>
>>>>> </class>
>>>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>>> <id type="long" name="e_id" column="e_id"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>>> <meta attribute="syntheticId">true</meta>
>>>>> <generator class="native"/>
>>>>> </id>
>>>>> <discriminator column="`dtype`" type="string"/>
>>>>> <version name="e_version" column="e_version"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>>> <meta attribute="syntheticVersion">true</meta>
>>>>> </version>
>>>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>>>> <key update="true">
>>>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>>>> unique="false"/>
>>>>> </key>
>>>>> <list-index column="`playtimehistory_events_idx`"/>
>>>>> <one-to-many entity-name="Event"/>
>>>>> </list>
>>>>> </class>
>>>>>
>>>>> In short I have a class with a member of type "EMap<DateTime, Type>"
>>>>> named "events" that gets mapped to a "list" in Hibernate. When my
>>>>> application adds an entry to the map and saves the model (using a
>>>>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>>>>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>>>>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>>>>> trace:
>>>>>
>>>>> java.lang.ClassCastException:
>>>>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>>>>> at
>>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>>>>> at
>>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>>>>> at
>>>>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>>>>> at
>>>>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>>>>> at
>>>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>>>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>> at
>>>>> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>>>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>>>>> at
>>>>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>>>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>>> at
>>>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>>>>> at
>>>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>>>>> at
>>>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>>>>> at
>>>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>>>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>>>>
>>>>> This code was working fine on the previous versions of the tool chain.
>>>>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>>>>
>>>>> Thanks,
>>>>> Chris
>>>> --
>>>>
>>>> With Regards, Martin Taal
>>>>
>>>> Springsite/Elver.org
>>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>>> The Netherlands
>>>> Tel: +31 (0)84 420 2397
>>>> Fax: +31 (0)84 225 9307
>>>> Mail: mtaal@springsite.com - mtaal@elver.org
>>>> Web: www.springsite.com - www.elver.org
>>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Tel: +31 (0)84 420 2397
>> Fax: +31 (0)84 225 9307
>> Mail: mtaal@springsite.com - mtaal@elver.org
>> Web: www.springsite.com - www.elver.org
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #608637 is a reply to message #88071] Thu, 05 July 2007 08:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I think it is related to the setting of the option: PersistenceOptions.EMAP_AS_TRUE_MAP. However it
should work with both true and false if you let Teneo create the mapping automatically.
Can you show me the relevant part of the in-memory mapping (do datastore.getMappingXML())?

gr. Martin

Chris Hines wrote:
> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019) from
> Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error during
> regression testing of my project.
>
> I have an EMF model that includes the following classes:
>
> <eClassifiers xsi:type="ecore:EEnum" name="Type">
> <eLiterals name="Started" literal="STARTED"/>
> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Event"
> instanceClassName="java.util.Map$Entry">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
> lowerBound="1"
> eType="#//playtimehistory/Type"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
> lowerBound="1"
> eType="#//DateTime"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
> lowerBound="1" eType="#//DateTime"
> volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
> lowerBound="1"
> eType="#//playtimehistory/Type" volatile="true" transient="true"
> derived="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
> upperBound="-1"
> eType="#//playtimehistory/Event" containment="true"
> eKeys="#//playtimehistory/Event/time"/>
> </eClassifiers>
>
> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
> generated using the Teneo context menu on my Ecore file contains the
> following relevant sections (with some java base packages and URLs edited
> for privacy reasons):
>
> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
> abstract="false" lazy="false" discriminator-value="Event" table="`event`">
> <meta attribute="eclassName">Event</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <property name="type" lazy="false" not-null="true" insert="true"
> update="true" unique="false">
> <column not-null="true" unique="false" name="`type`"/>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
> <param name="enumClass">model.playtimehistory.Type</param>
> </type>
> </property>
> <property name="time" lazy="false" insert="true" update="true"
> not-null="true" unique="false" type="model.DateTime">
> <column not-null="true" unique="false" name="`time`"/>
> </property>
> </class>
> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
> entity-name="PlaytimeHistory" abstract="false" lazy="false"
> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
> <meta attribute="eclassName">PlaytimeHistory</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <list name="events" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`playtimehistory_events_e_id`" not-null="false"
> unique="false"/>
> </key>
> <list-index column="`playtimehistory_events_idx`"/>
> <one-to-many entity-name="Event"/>
> </list>
> </class>
>
> In short I have a class with a member of type "EMap<DateTime, Type>" named
> "events" that gets mapped to a "list" in Hibernate. When my application
> adds an entry to the map and saves the model (using a Hibernate EMF
> Resource) I get a ClassCastException from deep in the bowels of Hibernate (v
> 3.2.3ga). Hibernate is trying to cast a BasicEMap$DelegatingMap to a
> java.lang.Collection. Here's the stack trace:
>
> java.lang.ClassCastException:
> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
> at
> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
> at
> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
> at
> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
> at
> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
> at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
> at
> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
> at
> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
> at
> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
> at
> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
> at org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>
> This code was working fine on the previous versions of the tool chain. Any
> ideas what is broken? Is it my model, Teneo, or Hibernate?
>
> Thanks,
> Chris
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #608654 is a reply to message #88088] Thu, 05 July 2007 22:29 Go to previous message
Chris Hines is currently offline Chris HinesFriend
Messages: 15
Registered: July 2009
Junior Member
Martin,

Thanks for the quick response.

The in-memory mapping is identical to the one I sent before according to an
automated comparison. Nontheless, here is the relevant part of the
in-memory mapping.

<class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
abstract="false" lazy="false" discriminator-value="Event" table="`event`">
<meta attribute="eclassName">Event</meta>
<meta attribute="epackage">http://PlaytimeHistory</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<property name="type" lazy="false" not-null="true" insert="true"
update="true" unique="false">
<column not-null="true" unique="false" name="`type`"/>
<type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
<param name="enumClass">model.playtimehistory.Type</param>
</type>
</property>
<property name="time" lazy="false" insert="true" update="true"
not-null="true" unique="false" type="model.DateTime">
<column not-null="true" unique="false" name="`time`"/>
</property>
</class>
<class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
entity-name="PlaytimeHistory" abstract="false" lazy="false"
discriminator-value="PlaytimeHistory" table="`playtimehistory`">
<meta attribute="eclassName">PlaytimeHistory</meta>
<meta attribute="epackage">http://PlaytimeHistory</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<list name="events" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`playtimehistory_events_e_id`" not-null="false"
unique="false"/>
</key>
<list-index column="`playtimehistory_events_idx`"/>
<one-to-many entity-name="Event"/>
</list>
</class>

Thanks,
Chris

"Martin Taal" <mtaal@elver.org> wrote in message
news:f6i8jl$37u$1@build.eclipse.org...
>I think it is related to the setting of the option:
>PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both true
>and false if you let Teneo create the mapping automatically.
> Can you show me the relevant part of the in-memory mapping (do
> datastore.getMappingXML())?
>
> gr. Martin
>
> Chris Hines wrote:
>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>> during regression testing of my project.
>>
>> I have an EMF model that includes the following classes:
>>
>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>> <eLiterals name="Started" literal="STARTED"/>
>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>> instanceClassName="java.util.Map$Entry">
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>> lowerBound="1"
>> eType="#//playtimehistory/Type"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>> lowerBound="1"
>> eType="#//DateTime"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>> lowerBound="1" eType="#//DateTime"
>> volatile="true" transient="true" derived="true"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>> lowerBound="1"
>> eType="#//playtimehistory/Type" volatile="true"
>> transient="true" derived="true"/>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>> upperBound="-1"
>> eType="#//playtimehistory/Event" containment="true"
>> eKeys="#//playtimehistory/Event/time"/>
>> </eClassifiers>
>>
>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>> generated using the Teneo context menu on my Ecore file contains the
>> following relevant sections (with some java base packages and URLs edited
>> for privacy reasons):
>>
>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>> abstract="false" lazy="false" discriminator-value="Event"
>> table="`event`">
>> <meta attribute="eclassName">Event</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <property name="type" lazy="false" not-null="true" insert="true"
>> update="true" unique="false">
>> <column not-null="true" unique="false" name="`type`"/>
>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>> <param name="enumClass">model.playtimehistory.Type</param>
>> </type>
>> </property>
>> <property name="time" lazy="false" insert="true" update="true"
>> not-null="true" unique="false" type="model.DateTime">
>> <column not-null="true" unique="false" name="`time`"/>
>> </property>
>> </class>
>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>> <meta attribute="eclassName">PlaytimeHistory</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <list name="events" lazy="true" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`playtimehistory_events_e_id`" not-null="false"
>> unique="false"/>
>> </key>
>> <list-index column="`playtimehistory_events_idx`"/>
>> <one-to-many entity-name="Event"/>
>> </list>
>> </class>
>>
>> In short I have a class with a member of type "EMap<DateTime, Type>"
>> named "events" that gets mapped to a "list" in Hibernate. When my
>> application adds an entry to the map and saves the model (using a
>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>> trace:
>>
>> java.lang.ClassCastException:
>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>> at
>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>> at
>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>> at
>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>> at
>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>> at
>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>> at
>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>> at
>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>> at
>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>> at
>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>> at
>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>
>> This code was working fine on the previous versions of the tool chain.
>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>
>> Thanks,
>> Chris
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Tel: +31 (0)84 420 2397
> Fax: +31 (0)84 225 9307
> Mail: mtaal@springsite.com - mtaal@elver.org
> Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #608672 is a reply to message #88342] Sun, 08 July 2007 22:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Chris,
I tried to reproduce this but I can't. I still think that this is related to the option:
EMAP_AS_TRUE_MAP. To what value do you set this option?
To be sure, the hbm you show below, is the one which goes wrong?
Can you make a small testcase which reproduces this?

gr. martin

Chris Hines wrote:
> Martin,
>
> Thanks for the quick response.
>
> The in-memory mapping is identical to the one I sent before according to an
> automated comparison. Nontheless, here is the relevant part of the
> in-memory mapping.
>
> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
> abstract="false" lazy="false" discriminator-value="Event" table="`event`">
> <meta attribute="eclassName">Event</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <property name="type" lazy="false" not-null="true" insert="true"
> update="true" unique="false">
> <column not-null="true" unique="false" name="`type`"/>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
> <param name="enumClass">model.playtimehistory.Type</param>
> </type>
> </property>
> <property name="time" lazy="false" insert="true" update="true"
> not-null="true" unique="false" type="model.DateTime">
> <column not-null="true" unique="false" name="`time`"/>
> </property>
> </class>
> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
> entity-name="PlaytimeHistory" abstract="false" lazy="false"
> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
> <meta attribute="eclassName">PlaytimeHistory</meta>
> <meta attribute="epackage">http://PlaytimeHistory</meta>
> <id type="long" name="e_id" column="e_id"
> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
> <meta attribute="syntheticId">true</meta>
> <generator class="native"/>
> </id>
> <discriminator column="`dtype`" type="string"/>
> <version name="e_version" column="e_version"
> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
> <meta attribute="syntheticVersion">true</meta>
> </version>
> <list name="events" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`playtimehistory_events_e_id`" not-null="false"
> unique="false"/>
> </key>
> <list-index column="`playtimehistory_events_idx`"/>
> <one-to-many entity-name="Event"/>
> </list>
> </class>
>
> Thanks,
> Chris
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f6i8jl$37u$1@build.eclipse.org...
>> I think it is related to the setting of the option:
>> PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both true
>> and false if you let Teneo create the mapping automatically.
>> Can you show me the relevant part of the in-memory mapping (do
>> datastore.getMappingXML())?
>>
>> gr. Martin
>>
>> Chris Hines wrote:
>>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>>> during regression testing of my project.
>>>
>>> I have an EMF model that includes the following classes:
>>>
>>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>>> <eLiterals name="Started" literal="STARTED"/>
>>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>>> </eClassifiers>
>>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>>> instanceClassName="java.util.Map$Entry">
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>>> lowerBound="1"
>>> eType="#//playtimehistory/Type"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>>> lowerBound="1"
>>> eType="#//DateTime"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>> lowerBound="1" eType="#//DateTime"
>>> volatile="true" transient="true" derived="true"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>> lowerBound="1"
>>> eType="#//playtimehistory/Type" volatile="true"
>>> transient="true" derived="true"/>
>>> </eClassifiers>
>>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>>> upperBound="-1"
>>> eType="#//playtimehistory/Event" containment="true"
>>> eKeys="#//playtimehistory/Event/time"/>
>>> </eClassifiers>
>>>
>>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>>> generated using the Teneo context menu on my Ecore file contains the
>>> following relevant sections (with some java base packages and URLs edited
>>> for privacy reasons):
>>>
>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>> abstract="false" lazy="false" discriminator-value="Event"
>>> table="`event`">
>>> <meta attribute="eclassName">Event</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <property name="type" lazy="false" not-null="true" insert="true"
>>> update="true" unique="false">
>>> <column not-null="true" unique="false" name="`type`"/>
>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>> <param name="enumClass">model.playtimehistory.Type</param>
>>> </type>
>>> </property>
>>> <property name="time" lazy="false" insert="true" update="true"
>>> not-null="true" unique="false" type="model.DateTime">
>>> <column not-null="true" unique="false" name="`time`"/>
>>> </property>
>>> </class>
>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>> <key update="true">
>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>> unique="false"/>
>>> </key>
>>> <list-index column="`playtimehistory_events_idx`"/>
>>> <one-to-many entity-name="Event"/>
>>> </list>
>>> </class>
>>>
>>> In short I have a class with a member of type "EMap<DateTime, Type>"
>>> named "events" that gets mapped to a "list" in Hibernate. When my
>>> application adds an entry to the map and saves the model (using a
>>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>>> trace:
>>>
>>> java.lang.ClassCastException:
>>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>>> at
>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>>> at
>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>>> at
>>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>>> at
>>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>>> at
>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>>> at
>>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>>> at
>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>>> at
>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>>> at
>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>>
>>> This code was working fine on the previous versions of the tool chain.
>>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>>
>>> Thanks,
>>> Chris
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Tel: +31 (0)84 420 2397
>> Fax: +31 (0)84 225 9307
>> Mail: mtaal@springsite.com - mtaal@elver.org
>> Web: www.springsite.com - www.elver.org
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #608673 is a reply to message #88609] Mon, 09 July 2007 03:36 Go to previous message
Chris Hines is currently offline Chris HinesFriend
Messages: 15
Registered: July 2009
Junior Member
Martin,

If I call dataStore.getPersistenceOptions() after dataStore.initialize() the
return value indicates that teneo.mapping.emap_as_true_map=true.

However, since you didn't think that the value of this option should matter
in your earlier message, I decided to try something else based on a hunch I
had, and I have fixed the problem.

More detail:

If you look closely at the section of my model that I included in my
original message you will notice that my Map$Entry class named Event is a
bit unusual. It has four attributes, respectively named time, type, key,
and value. Attributes time and type are the real (non-volatile) fields, and
key and value are derived/transient/volatile fields that are implemented to
return the values of time and type respectively. I built my model this way
so that I could use domain specific getters and setters when manipulating
the model while also satisfying EMF's desire to have key and value fields
for its maps.

My hunch was that perhaps this unusual Map$Entry class definition was
causing Teneo some problems. My hunch appears to be correct. I removed the
time and type attributes from my model and converted the key and value to
concrete attributes. After regenerating my code Teneo now produces the
following mapping XML for the event class:

<map name="events" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`playtimehistory_events_e_id`" not-null="false"
unique="false"/>
</key>
<map-key type="model.DateTime"/>
<element>
<type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
<param name="enumClass">model.playtimehistory.Type</param>
</type>
</element>
</map>

And more important, my data is properly persisted.

It is curious, however, that the original model worked with Teneo 0.7.5, but
was broken with Teneo 0.8. I'm not sure if this was on purpose. Perhaps it
is something you care enough to look into.

For my part, I can live with the more abstract key and value fields if it
means my code works.

Thanks for your time and effort looking into this.

Chris

"Martin Taal" <mtaal@elver.org> wrote in message
news:f6rnbe$dvi$1@build.eclipse.org...
> Chris,
> I tried to reproduce this but I can't. I still think that this is related
> to the option: EMAP_AS_TRUE_MAP. To what value do you set this option?
> To be sure, the hbm you show below, is the one which goes wrong?
> Can you make a small testcase which reproduces this?
>
> gr. martin
>
> Chris Hines wrote:
>> Martin,
>>
>> Thanks for the quick response.
>>
>> The in-memory mapping is identical to the one I sent before according to
>> an automated comparison. Nontheless, here is the relevant part of the
>> in-memory mapping.
>>
>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>> abstract="false" lazy="false" discriminator-value="Event"
>> table="`event`">
>> <meta attribute="eclassName">Event</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <property name="type" lazy="false" not-null="true" insert="true"
>> update="true" unique="false">
>> <column not-null="true" unique="false" name="`type`"/>
>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>> <param name="enumClass">model.playtimehistory.Type</param>
>> </type>
>> </property>
>> <property name="time" lazy="false" insert="true" update="true"
>> not-null="true" unique="false" type="model.DateTime">
>> <column not-null="true" unique="false" name="`time`"/>
>> </property>
>> </class>
>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>> <meta attribute="eclassName">PlaytimeHistory</meta>
>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>> <id type="long" name="e_id" column="e_id"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>> <meta attribute="syntheticId">true</meta>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`dtype`" type="string"/>
>> <version name="e_version" column="e_version"
>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>> <meta attribute="syntheticVersion">true</meta>
>> </version>
>> <list name="events" lazy="true" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`playtimehistory_events_e_id`" not-null="false"
>> unique="false"/>
>> </key>
>> <list-index column="`playtimehistory_events_idx`"/>
>> <one-to-many entity-name="Event"/>
>> </list>
>> </class>
>>
>> Thanks,
>> Chris
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:f6i8jl$37u$1@build.eclipse.org...
>>> I think it is related to the setting of the option:
>>> PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both
>>> true and false if you let Teneo create the mapping automatically.
>>> Can you show me the relevant part of the in-memory mapping (do
>>> datastore.getMappingXML())?
>>>
>>> gr. Martin
>>>
>>> Chris Hines wrote:
>>>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>>>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>>>> during regression testing of my project.
>>>>
>>>> I have an EMF model that includes the following classes:
>>>>
>>>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>>>> <eLiterals name="Started" literal="STARTED"/>
>>>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>>>> </eClassifiers>
>>>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>>>> instanceClassName="java.util.Map$Entry">
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>>>> lowerBound="1"
>>>> eType="#//playtimehistory/Type"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>>>> lowerBound="1"
>>>> eType="#//DateTime"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>> lowerBound="1" eType="#//DateTime"
>>>> volatile="true" transient="true" derived="true"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>> lowerBound="1"
>>>> eType="#//playtimehistory/Type" volatile="true"
>>>> transient="true" derived="true"/>
>>>> </eClassifiers>
>>>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>>>> upperBound="-1"
>>>> eType="#//playtimehistory/Event" containment="true"
>>>> eKeys="#//playtimehistory/Event/time"/>
>>>> </eClassifiers>
>>>>
>>>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>>>> generated using the Teneo context menu on my Ecore file contains the
>>>> following relevant sections (with some java base packages and URLs
>>>> edited for privacy reasons):
>>>>
>>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>>> abstract="false" lazy="false" discriminator-value="Event"
>>>> table="`event`">
>>>> <meta attribute="eclassName">Event</meta>
>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>> <id type="long" name="e_id" column="e_id"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>> <meta attribute="syntheticId">true</meta>
>>>> <generator class="native"/>
>>>> </id>
>>>> <discriminator column="`dtype`" type="string"/>
>>>> <version name="e_version" column="e_version"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>> <meta attribute="syntheticVersion">true</meta>
>>>> </version>
>>>> <property name="type" lazy="false" not-null="true" insert="true"
>>>> update="true" unique="false">
>>>> <column not-null="true" unique="false" name="`type`"/>
>>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>>> <param name="enumClass">model.playtimehistory.Type</param>
>>>> </type>
>>>> </property>
>>>> <property name="time" lazy="false" insert="true" update="true"
>>>> not-null="true" unique="false" type="model.DateTime">
>>>> <column not-null="true" unique="false" name="`time`"/>
>>>> </property>
>>>> </class>
>>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>> <id type="long" name="e_id" column="e_id"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>> <meta attribute="syntheticId">true</meta>
>>>> <generator class="native"/>
>>>> </id>
>>>> <discriminator column="`dtype`" type="string"/>
>>>> <version name="e_version" column="e_version"
>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>> <meta attribute="syntheticVersion">true</meta>
>>>> </version>
>>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>>> <key update="true">
>>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>>> unique="false"/>
>>>> </key>
>>>> <list-index column="`playtimehistory_events_idx`"/>
>>>> <one-to-many entity-name="Event"/>
>>>> </list>
>>>> </class>
>>>>
>>>> In short I have a class with a member of type "EMap<DateTime, Type>"
>>>> named "events" that gets mapped to a "list" in Hibernate. When my
>>>> application adds an entry to the map and saves the model (using a
>>>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>>>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>>>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>>>> trace:
>>>>
>>>> java.lang.ClassCastException:
>>>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>>>> at
>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>>>> at
>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>>>> at
>>>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>>>> at
>>>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>>>> at
>>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>> at
>>>> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>>>> at
>>>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>> at
>>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>>>> at
>>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>>>> at
>>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>>>> at
>>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>>>
>>>> This code was working fine on the previous versions of the tool chain.
>>>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>>>
>>>> Thanks,
>>>> Chris
>>>
>>> --
>>>
>>> With Regards, Martin Taal
>>>
>>> Springsite/Elver.org
>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>> The Netherlands
>>> Tel: +31 (0)84 420 2397
>>> Fax: +31 (0)84 225 9307
>>> Mail: mtaal@springsite.com - mtaal@elver.org
>>> Web: www.springsite.com - www.elver.org
>>
>>
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Tel: +31 (0)84 420 2397
> Fax: +31 (0)84 225 9307
> Mail: mtaal@springsite.com - mtaal@elver.org
> Web: www.springsite.com - www.elver.org
Re: [Teneo] ClassCastException from hibernate trying to persist a new EMap entry. [message #608674 is a reply to message #88624] Mon, 09 July 2007 07:13 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Chris,
Thanks for the update. It seems that looking at the previous mapping that
teneo.mapping.emap_as_true_map was false (as the map was mapped as a list). So that's what I looked
at most. I hadn't noticed that the key/value eattributes were volatile/transient. I will try this
out later.

gr. Maritn

Chris Hines wrote:
> Martin,
>
> If I call dataStore.getPersistenceOptions() after dataStore.initialize() the
> return value indicates that teneo.mapping.emap_as_true_map=true.
>
> However, since you didn't think that the value of this option should matter
> in your earlier message, I decided to try something else based on a hunch I
> had, and I have fixed the problem.
>
> More detail:
>
> If you look closely at the section of my model that I included in my
> original message you will notice that my Map$Entry class named Event is a
> bit unusual. It has four attributes, respectively named time, type, key,
> and value. Attributes time and type are the real (non-volatile) fields, and
> key and value are derived/transient/volatile fields that are implemented to
> return the values of time and type respectively. I built my model this way
> so that I could use domain specific getters and setters when manipulating
> the model while also satisfying EMF's desire to have key and value fields
> for its maps.
>
> My hunch was that perhaps this unusual Map$Entry class definition was
> causing Teneo some problems. My hunch appears to be correct. I removed the
> time and type attributes from my model and converted the key and value to
> concrete attributes. After regenerating my code Teneo now produces the
> following mapping XML for the event class:
>
> <map name="events" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`playtimehistory_events_e_id`" not-null="false"
> unique="false"/>
> </key>
> <map-key type="model.DateTime"/>
> <element>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
> <param name="enumClass">model.playtimehistory.Type</param>
> </type>
> </element>
> </map>
>
> And more important, my data is properly persisted.
>
> It is curious, however, that the original model worked with Teneo 0.7.5, but
> was broken with Teneo 0.8. I'm not sure if this was on purpose. Perhaps it
> is something you care enough to look into.
>
> For my part, I can live with the more abstract key and value fields if it
> means my code works.
>
> Thanks for your time and effort looking into this.
>
> Chris
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f6rnbe$dvi$1@build.eclipse.org...
>> Chris,
>> I tried to reproduce this but I can't. I still think that this is related
>> to the option: EMAP_AS_TRUE_MAP. To what value do you set this option?
>> To be sure, the hbm you show below, is the one which goes wrong?
>> Can you make a small testcase which reproduces this?
>>
>> gr. martin
>>
>> Chris Hines wrote:
>>> Martin,
>>>
>>> Thanks for the quick response.
>>>
>>> The in-memory mapping is identical to the one I sent before according to
>>> an automated comparison. Nontheless, here is the relevant part of the
>>> in-memory mapping.
>>>
>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>> abstract="false" lazy="false" discriminator-value="Event"
>>> table="`event`">
>>> <meta attribute="eclassName">Event</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <property name="type" lazy="false" not-null="true" insert="true"
>>> update="true" unique="false">
>>> <column not-null="true" unique="false" name="`type`"/>
>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>> <param name="enumClass">model.playtimehistory.Type</param>
>>> </type>
>>> </property>
>>> <property name="time" lazy="false" insert="true" update="true"
>>> not-null="true" unique="false" type="model.DateTime">
>>> <column not-null="true" unique="false" name="`time`"/>
>>> </property>
>>> </class>
>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>> <id type="long" name="e_id" column="e_id"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>> <meta attribute="syntheticId">true</meta>
>>> <generator class="native"/>
>>> </id>
>>> <discriminator column="`dtype`" type="string"/>
>>> <version name="e_version" column="e_version"
>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>> <meta attribute="syntheticVersion">true</meta>
>>> </version>
>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>> <key update="true">
>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>> unique="false"/>
>>> </key>
>>> <list-index column="`playtimehistory_events_idx`"/>
>>> <one-to-many entity-name="Event"/>
>>> </list>
>>> </class>
>>>
>>> Thanks,
>>> Chris
>>>
>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>> news:f6i8jl$37u$1@build.eclipse.org...
>>>> I think it is related to the setting of the option:
>>>> PersistenceOptions.EMAP_AS_TRUE_MAP. However it should work with both
>>>> true and false if you let Teneo create the mapping automatically.
>>>> Can you show me the relevant part of the in-memory mapping (do
>>>> datastore.getMappingXML())?
>>>>
>>>> gr. Martin
>>>>
>>>> Chris Hines wrote:
>>>>> I just upgraded to Eclipse 3.3, EMF 2.3, and Teneo 0.8 (I200704230019)
>>>>> from Eclipse 3.2 EMF 2.2 and Teneo 0.7.5 and I'm encountering an error
>>>>> during regression testing of my project.
>>>>>
>>>>> I have an EMF model that includes the following classes:
>>>>>
>>>>> <eClassifiers xsi:type="ecore:EEnum" name="Type">
>>>>> <eLiterals name="Started" literal="STARTED"/>
>>>>> <eLiterals name="Stopped" value="1" literal="STOPPED"/>
>>>>> </eClassifiers>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="Event"
>>>>> instanceClassName="java.util.Map$Entry">
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
>>>>> lowerBound="1"
>>>>> eType="#//playtimehistory/Type"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="time"
>>>>> lowerBound="1"
>>>>> eType="#//DateTime"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>>> lowerBound="1" eType="#//DateTime"
>>>>> volatile="true" transient="true" derived="true"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>>> lowerBound="1"
>>>>> eType="#//playtimehistory/Type" volatile="true"
>>>>> transient="true" derived="true"/>
>>>>> </eClassifiers>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="PlaytimeHistory">
>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="events"
>>>>> upperBound="-1"
>>>>> eType="#//playtimehistory/Event" containment="true"
>>>>> eKeys="#//playtimehistory/Event/time"/>
>>>>> </eClassifiers>
>>>>>
>>>>> My code lets Teneo use an in-memory Hibernate mapping. A mapping file
>>>>> generated using the Teneo context menu on my Ecore file contains the
>>>>> following relevant sections (with some java base packages and URLs
>>>>> edited for privacy reasons):
>>>>>
>>>>> <class name="model.playtimehistory.impl.EventImpl" entity-name="Event"
>>>>> abstract="false" lazy="false" discriminator-value="Event"
>>>>> table="`event`">
>>>>> <meta attribute="eclassName">Event</meta>
>>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>>> <id type="long" name="e_id" column="e_id"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>>> <meta attribute="syntheticId">true</meta>
>>>>> <generator class="native"/>
>>>>> </id>
>>>>> <discriminator column="`dtype`" type="string"/>
>>>>> <version name="e_version" column="e_version"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>>> <meta attribute="syntheticVersion">true</meta>
>>>>> </version>
>>>>> <property name="type" lazy="false" not-null="true" insert="true"
>>>>> update="true" unique="false">
>>>>> <column not-null="true" unique="false" name="`type`"/>
>>>>> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType" >
>>>>> <param name="enumClass">model.playtimehistory.Type</param>
>>>>> </type>
>>>>> </property>
>>>>> <property name="time" lazy="false" insert="true" update="true"
>>>>> not-null="true" unique="false" type="model.DateTime">
>>>>> <column not-null="true" unique="false" name="`time`"/>
>>>>> </property>
>>>>> </class>
>>>>> <class name="model.playtimehistory.impl.PlaytimeHistoryImpl"
>>>>> entity-name="PlaytimeHistory" abstract="false" lazy="false"
>>>>> discriminator-value="PlaytimeHistory" table="`playtimehistory`">
>>>>> <meta attribute="eclassName">PlaytimeHistory</meta>
>>>>> <meta attribute="epackage">http://PlaytimeHistory</meta>
>>>>> <id type="long" name="e_id" column="e_id"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
>>>>> <meta attribute="syntheticId">true</meta>
>>>>> <generator class="native"/>
>>>>> </id>
>>>>> <discriminator column="`dtype`" type="string"/>
>>>>> <version name="e_version" column="e_version"
>>>>> access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
>>>>> <meta attribute="syntheticVersion">true</meta>
>>>>> </version>
>>>>> <list name="events" lazy="true" cascade="all,delete-orphan">
>>>>> <key update="true">
>>>>> <column name="`playtimehistory_events_e_id`" not-null="false"
>>>>> unique="false"/>
>>>>> </key>
>>>>> <list-index column="`playtimehistory_events_idx`"/>
>>>>> <one-to-many entity-name="Event"/>
>>>>> </list>
>>>>> </class>
>>>>>
>>>>> In short I have a class with a member of type "EMap<DateTime, Type>"
>>>>> named "events" that gets mapped to a "list" in Hibernate. When my
>>>>> application adds an entry to the map and saves the model (using a
>>>>> Hibernate EMF Resource) I get a ClassCastException from deep in the
>>>>> bowels of Hibernate (v 3.2.3ga). Hibernate is trying to cast a
>>>>> BasicEMap$DelegatingMap to a java.lang.Collection. Here's the stack
>>>>> trace:
>>>>>
>>>>> java.lang.ClassCastException:
>>>>> org.eclipse.emf.common.util.BasicEMap$DelegatingMap
>>>>> at
>>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:211)
>>>>> at
>>>>> org.hibernate.type.CollectionType.getElementsIterator(Collec tionType.java:200)
>>>>> at
>>>>> org.hibernate.engine.CascadingAction.getLoadedElementsIterat or(CascadingAction.java:425)
>>>>> at
>>>>> org.hibernate.engine.CascadingAction$1.getCascadableChildren Iterator(CascadingAction.java:222)
>>>>> at
>>>>> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:294)
>>>>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
>>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
>>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:334)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:181)
>>>>> at
>>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:107)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:187)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>>>>> at
>>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>>>>> at
>>>>> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
>>>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
>>>>> at
>>>>> org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:218)
>>>>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>>>>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
>>>>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
>>>>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>>>>> at
>>>>> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>>>>> at
>>>>> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>>>>> at
>>>>> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>>>>> at
>>>>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>>>>> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:153)
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:349)
>>>>>
>>>>> This code was working fine on the previous versions of the tool chain.
>>>>> Any ideas what is broken? Is it my model, Teneo, or Hibernate?
>>>>>
>>>>> Thanks,
>>>>> Chris
>>>> --
>>>>
>>>> With Regards, Martin Taal
>>>>
>>>> Springsite/Elver.org
>>>> Office: Hardwareweg 4, 3821 BV Amersfoort
>>>> Postal: Nassaulaan 7, 3941 EC Doorn
>>>> The Netherlands
>>>> Tel: +31 (0)84 420 2397
>>>> Fax: +31 (0)84 225 9307
>>>> Mail: mtaal@springsite.com - mtaal@elver.org
>>>> Web: www.springsite.com - www.elver.org
>>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Tel: +31 (0)84 420 2397
>> Fax: +31 (0)84 225 9307
>> Mail: mtaal@springsite.com - mtaal@elver.org
>> Web: www.springsite.com - www.elver.org
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Can Teneo start from the database schema as a model?
Next Topic:[EMF Compare] 0.7.0RC1 release !
Goto Forum:
  


Current Time: Thu Aug 11 15:49:44 GMT 2022

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

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

Back to the top