Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Exception in Teneo query
Exception in Teneo query [message #424786] Wed, 05 November 2008 13:01 Go to next message
Pavel Bernshtam is currently offline Pavel BernshtamFriend
Messages: 36
Registered: July 2009
Member
I have a Run class with list of strings:

public interface Run extends EObject
{

...

/**
* @model
* @return
*/
public EList<String> getMessages();
}

My ecore model is here http://bernshtam.name/temp/vm.ecore

I make following query:
Query q = _session.createQuery("from Run as run where
run.status = ? and ? in elements(run.messages)");
q.setMaxResults(200);
q.setFirstResult(100);
q.setInteger(0, status);
q.setString(1, string);
List<Run> runs = q.list();

and receive exception:
Nov 5, 2008 2:51:14 PM org.eclipse.emf.teneo.TeneoException <init>
SEVERE: Exception when setting eContainerFeatureID for:
com.cadence.pavel.vm.impl.RunImpl to value: null
org.eclipse.emf.teneo.hibernate.HbMapperException: Exception when setting
eContainerFeatureID for: com.cadence.pavel.vm.impl.RunImpl to value: null
at
org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rFeatureIDPropertyHandler.set(EContainerFeatureIDPropertyHan dler.java:90)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
at
org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3571)
at
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:133)
at
org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:3 78)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslat orImpl.java:338)
at
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQuery Plan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.cadence.pavel.JDBCSolution.selectRuns(JDBCSolution.java: 71)
at com.cadence.pavel.DBQuery.main(DBQuery.java:22)


What I'm doing wrong?

Thank you
Re: Exception in Teneo query [message #424792 is a reply to message #424786] Wed, 05 November 2008 14:05 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavel,
It seems that the container of the Run object has not been set in the db. I will try this out a
little later today and let you know what I found.

gr. Martin


Pavel Bernshtam wrote:
> I have a Run class with list of strings:
>
> public interface Run extends EObject
> {
>
> ...
>
> /**
> * @model * @return
> */
> public EList<String> getMessages();
> }
>
> My ecore model is here http://bernshtam.name/temp/vm.ecore
>
> I make following query:
> Query q = _session.createQuery("from Run as run where
> run.status = ? and ? in elements(run.messages)");
> q.setMaxResults(200);
> q.setFirstResult(100);
> q.setInteger(0, status);
> q.setString(1, string);
> List<Run> runs = q.list();
>
> and receive exception:
> Nov 5, 2008 2:51:14 PM org.eclipse.emf.teneo.TeneoException <init>
> SEVERE: Exception when setting eContainerFeatureID for:
> com.cadence.pavel.vm.impl.RunImpl to value: null
> org.eclipse.emf.teneo.hibernate.HbMapperException: Exception when
> setting eContainerFeatureID for: com.cadence.pavel.vm.impl.RunImpl to
> value: null
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rFeatureIDPropertyHandler.set(EContainerFeatureIDPropertyHan dler.java:90)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3571)
>
> at
> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:133)
> at
> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
>
> at org.hibernate.loader.Loader.doQuery(Loader.java:729)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
>
> at org.hibernate.loader.Loader.doList(Loader.java:2213)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2104)
> at org.hibernate.loader.Loader.list(Loader.java:2099)
> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:3 78)
> at
> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslat orImpl.java:338)
>
> at
> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQuery Plan.java:172)
> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
> at com.cadence.pavel.JDBCSolution.selectRuns(JDBCSolution.java: 71)
> at com.cadence.pavel.DBQuery.main(DBQuery.java:22)
>
>
> What I'm doing wrong?
>
> Thank you
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Exception in Teneo query [message #424805 is a reply to message #424792] Wed, 05 November 2008 20:54 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavel,
I tested this (also with your query) and with me it works fine.

I think the following happened. In your first model you did not have the containment set. So the
database and the records were created without the econtainer columns. Then when you changed your
model the econtainer columns were created. For existing records the value of the new columns is set
to null. As the econtainterfeatureid is a primitive field it can not handle null values. I will
repair this in a new build (in a few days) so the behavior will be more robust.

In the meantime if you recreate the database then this should go away.
Let me know if you still have issues.

gr. Martin

Martin Taal wrote:
> Hi Pavel,
> It seems that the container of the Run object has not been set in the
> db. I will try this out a little later today and let you know what I found.
>
> gr. Martin
>
>
> Pavel Bernshtam wrote:
>> I have a Run class with list of strings:
>>
>> public interface Run extends EObject
>> {
>> ...
>>
>> /**
>> * @model * @return
>> */
>> public EList<String> getMessages();
>> }
>>
>> My ecore model is here http://bernshtam.name/temp/vm.ecore
>>
>> I make following query:
>> Query q = _session.createQuery("from Run as run where
>> run.status = ? and ? in elements(run.messages)");
>> q.setMaxResults(200);
>> q.setFirstResult(100);
>> q.setInteger(0, status);
>> q.setString(1, string);
>> List<Run> runs = q.list();
>>
>> and receive exception:
>> Nov 5, 2008 2:51:14 PM org.eclipse.emf.teneo.TeneoException <init>
>> SEVERE: Exception when setting eContainerFeatureID for:
>> com.cadence.pavel.vm.impl.RunImpl to value: null
>> org.eclipse.emf.teneo.hibernate.HbMapperException: Exception when
>> setting eContainerFeatureID for: com.cadence.pavel.vm.impl.RunImpl to
>> value: null
>> at
>> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rFeatureIDPropertyHandler.set(EContainerFeatureIDPropertyHan dler.java:90)
>>
>> at
>> org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3571)
>>
>> at
>> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:133)
>> at
>> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
>>
>> at org.hibernate.loader.Loader.doQuery(Loader.java:729)
>> at
>> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
>>
>> at org.hibernate.loader.Loader.doList(Loader.java:2213)
>> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java :2104)
>> at org.hibernate.loader.Loader.list(Loader.java:2099)
>> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:3 78)
>> at
>> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslat orImpl.java:338)
>>
>> at
>> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQuery Plan.java:172)
>>
>> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
>> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
>> at com.cadence.pavel.JDBCSolution.selectRuns(JDBCSolution.java: 71)
>> at com.cadence.pavel.DBQuery.main(DBQuery.java:22)
>>
>>
>> What I'm doing wrong?
>>
>> Thank you
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Exception in Teneo query [message #424823 is a reply to message #424805] Thu, 06 November 2008 07:53 Go to previous message
Pavel Bernshtam is currently offline Pavel BernshtamFriend
Messages: 36
Registered: July 2009
Member
Seems to be okay.

Thank you!
Previous Topic:[Teneo] Does Teneo + EclipseLink support dynamic EMF?
Next Topic:What is the org.eclipse.emf.java example?
Goto Forum:
  


Current Time: Sat Apr 27 02:15:43 GMT 2024

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

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

Back to the top