Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Illegal Argument Exception saving null object enumeration
[Teneo] Illegal Argument Exception saving null object enumeration [message #609497] Tue, 21 August 2007 18:05
Jeff Bellegarde is currently offline Jeff BellegardeFriend
Messages: 6
Registered: July 2009
Junior Member
I'm trying to save a model and receiving the following error.


java.lang.IllegalArgumentException: The value 'null' is not a valid
enumerator of 'Period'
at
org.search.jiem.model.impl.JiemFactoryImpl.createPeriodFromS tring(JiemFactoryImpl.java:565)
at
org.search.jiem.model.impl.JiemFactoryImpl.createPeriodObjec tFromString(JiemFactoryImpl.java:527)
at
org.search.jiem.model.impl.JiemFactoryImpl.createFromString( JiemFactoryImpl.java:141)
at
org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype.deepCopy(DefaultToStringUserType.java:77)
at org.hibernate.type.CustomType.deepCopy(CustomType.java:179)
at org.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:354 )
at
org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:274)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:180)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:121)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
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.cascadeCollectionElements(Casca de.java:296)
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:437)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:326)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:180)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:121)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
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.AbstractSaveEventListener.cascadeBef oreSave(AbstractSaveEventListener.java:412)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:261)
at
org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:180)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:121)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
at
org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at
org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at
org.search.jiem.exporting.ExportSiteModel.storeInDatabase(Ex portSiteModel.java:35)
at
org.search.jiem.exporting.ExportSiteModelTest.testSimple(Exp ortSiteModelTest.java:164)


The important section of the model is:

<eClassifiers xsi:type="ecore:EClass" name="Exchange">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="period"
unique="false"
eType="#//PeriodObject" unsettable="true"/>
</eClassifiers>

<eClassifiers xsi:type="ecore:EEnum" name="Period">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="Period"/>
</eAnnotations>
<eLiterals name="Hour"/>
<eLiterals name="Day" value="1"/>
<eLiterals name="Week" value="2"/>
<eLiterals name="Year" value="3"/>
<eLiterals name="Month" value="4"/>
</eClassifiers>

<eClassifiers xsi:type="ecore:EDataType" name="PeriodObject"
instanceClassName="org.eclipse.emf.common.util.Enumerator">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="Period:Object"/>
<details key="baseType" value="Period"/>
</eAnnotations>
</eClassifiers>

The indirection through PeriodObject is to allow Exchange.period to be
set to null. Pointing Exchange.period directly to Period saves
correctly, but disallows having a null period.

It looks like Teneo is ignoring the PeriodObject and just dealing with
the Period enum which can not be null.

Is there a way to get Teneo to save a null enum reference correctly?
Previous Topic:DataStore.initialize fails with eclipse.org/bpel - Model
Next Topic:Teneo Query By Example
Goto Forum:
  


Current Time: Fri Aug 19 01:37:52 GMT 2022

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

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

Back to the top