cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: How to create a EJBLQuery with a named parameterized query stored in the mapping?
Date Fri, 29 Jun 2012 06:23:56 GMT
No, this is unrelated to NamedQuery/EJBQL.

> Everything happened because, for some reason, the modeler and the cayenne
> runtime didn't alert me about a xml problem: a missing
> <db-relationship-path> tag. 

This is odd. I am pretty sure we have this validation. Please open a Jira and attach a sample
invalid model.

Thanks,
Andrus

On Jun 29, 2012, at 12:26 AM, gilbertoca wrote:

> I don't know if it has relation, but I've spent the whole day with one
> problem:
> 
> 
>> AXPAYERS510; customer=>?; version=>0]}
>> Jun 28, 2012 5:59:43 PM org.apache.cayenne.log.CommonsJdbcEventLogger
>> logBeginTransaction
>> INFO: --- transaction started.
>> Jun 28, 2012 5:59:43 PM org.apache.cayenne.log.CommonsJdbcEventLogger
>> logQueryError
>> INFO: *** error.
>> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>>        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
>>        at java.util.ArrayList.get(ArrayList.java:322)
>>        at
>> java.util.Collections$UnmodifiableList.get(Collections.java:1154)
>>        at
>> org.apache.cayenne.access.trans.SelectTranslator$1.visitRelationship(SelectTranslator.java:378)
>>        at
>> org.apache.cayenne.access.trans.SelectTranslator$1.visitToOne(SelectTranslator.java:370)
>>        at
>> org.apache.cayenne.reflect.generic.DataObjectToOneProperty.visit(DataObjectToOneProperty.java:87)
>>        at
>> org.apache.cayenne.reflect.PersistentDescriptor.visitDeclaredProperties(PersistentDescriptor.java:356)
>>        at
>> org.apache.cayenne.reflect.PersistentDescriptor.visitProperties(PersistentDescriptor.java:388)
>>        at
>> org.apache.cayenne.reflect.PersistentDescriptor.visitAllProperties(PersistentDescriptor.java:368)
>>        at
>> org.apache.cayenne.reflect.LazyClassDescriptorDecorator.visitAllProperties(LazyClassDescriptorDecorator.java:179)
>>        at
>> org.apache.cayenne.access.trans.SelectTranslator.appendQueryColumns(SelectTranslator.java:390)
>>        at
>> org.apache.cayenne.access.trans.SelectTranslator.buildResultColumns(SelectTranslator.java:298)
>>        at
>> org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:126)
>>        at
>> org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:204)
>>        at
>> org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:70)
>>        at
>> org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
>>        at
>> org.apache.cayenne.access.DataNode.performQueries(DataNode.java:280)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:432)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:405)
>>        at
>> org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:873)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:402)
>>        at
>> org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
>>        at
>> org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:754)
>>        at
>> org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:1003)
>>        at
>> org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:744)
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:350)
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:106)
>>        at
>> org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:93)
>>        at
>> org.apache.cayenne.access.DataContext.onQuery(DataContext.java:989)
>>        at
>> org.apache.cayenne.access.DataContext.performQuery(DataContext.java:978)
>>        at
>> org.apache.cayenne.access.ToOneFault.doResolveFault(ToOneFault.java:81)
>>        at
>> org.apache.cayenne.access.ToOneFault.resolveFault(ToOneFault.java:54)
>>        at
>> org.apache.cayenne.CayenneDataObject.readProperty(CayenneDataObject.java:186)
>>        at
>> org.apache.cayenne.reflect.generic.DataObjectBaseProperty.readProperty(DataObjectBaseProperty.java:41)
>>        at
>> org.apache.cayenne.ObjectContextDeleteAction.processDeleteRules(ObjectContextDeleteAction.java:153)
>>        at
>> org.apache.cayenne.ObjectContextDeleteAction.deletePersistent(ObjectContextDeleteAction.java:112)
>>        at
>> org.apache.cayenne.ObjectContextDeleteAction.performDelete(ObjectContextDeleteAction.java:91)
>>        at
>> org.apache.cayenne.BaseContext.deleteObjects(BaseContext.java:698)
>>        at park.model.LegalEntityTest.DeleteById(LegalEntityTest.java:89)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at
>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>        at
>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>        at
>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>        at
>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>>        at
>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>>        at
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>>        at
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>>        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>        at
>> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>        at
>> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>        at
>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>>        at
>> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>>        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>        at
>> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
>>        at
>> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
>>        at
>> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at
>> org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
>>        at $Proxy0.invoke(Unknown Source)
>>        at
>> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
>>        at
>> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
>>        at
>> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
>> 
>> 
> 
> Everything happened because, for some reason, the modeler and the cayenne
> runtime didn't alert me about a xml problem: a missing
> <db-relationship-path> tag. 
> I've found the validation problem with NetBeans.
> Regards,
> 
> Gilberto
> 
> --
> View this message in context: http://cayenne.195.n3.nabble.com/How-to-create-a-EJBLQuery-with-a-named-parameterized-query-stored-in-the-mapping-tp4024333p4024338.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
> 


Mime
View raw message