openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-229) OpenJPA fails with MappedSuperclasses and Entities with the same short names
Date Wed, 25 Apr 2007 09:25:16 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Patrick Linskey updated OPENJPA-229:
------------------------------------

          Component/s: kernel
        Fix Version/s: 0.9.8
          Description: 
When running the test case from OPENJPA-228 (after a few modifications to get it working),
I get the exception included below. If I change the 'Article' mapped superclass to be named
'ArticleBase', things work.

It looks like this is happening because multiple classes are registering for the same alias.
We should change the enhancer to not register aliases for mapped superclasses.

Exception in thread "main" <0.0.0 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
0
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:805)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:762)
	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:230)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:269)
	at nl.reinders.bm.BMTestOpenJPA.main(BMTestOpenJPA.java:41)
	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:585)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.apache.openjpa.jdbc.kernel.exps.PCPath.appendTo(PCPath.java:636)
	at org.apache.openjpa.jdbc.kernel.exps.FilterValueImpl.appendTo(FilterValueImpl.java:62)
	at org.apache.openjpa.jdbc.kernel.exps.FilterValueImpl.appendTo(FilterValueImpl.java:58)
	at org.apache.openjpa.jdbc.sql.DBDictionary.appendCast(DBDictionary.java:2486)
	at org.apache.openjpa.jdbc.sql.DBDictionary.comparison(DBDictionary.java:2443)
	at org.apache.openjpa.jdbc.kernel.exps.CompareExpression.appendTo(CompareExpression.java:75)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere(SelectConstructor.java:238)
	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate(SelectConstructor.java:79)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects(JDBCStoreQuery.java:330)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(JDBCStoreQuery.java:169)
	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:677)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:985)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)
	... 11 more


  was:
This: 

	        List lArticles = lEntityManager.createQuery("select a from Article a where a.iArticlenr
< 103").getResultList(); // where articlenr < 103

Results in:

Exception in thread "main" <0.9.7-incubating fatal user error> org.apache.openjpa.persistence.ArgumentException:
Could not locate metadata for the class using alias "Article". Registered alias mappings:
"{Article=null}"
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:348)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:167)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:145)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:214)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:184)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:177)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500(JPQLExpressionBuilder.java:64)
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:1671)
	at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:55)
	at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:148)
	at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:649)
	at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:630)
	at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:596)
	at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:658)
	at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1483)
	at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:219)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:269)
	at nl.reinders.bm.BMTestOpenJPA.main(BMTestOpenJPA.java:41)


    Affects Version/s: 0.9.0
             Reporter: Patrick Linskey  (was: Tom)

> OpenJPA fails with MappedSuperclasses and Entities with the same short names
> ----------------------------------------------------------------------------
>
>                 Key: OPENJPA-229
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-229
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>         Environment: WindowsXP SP2 full updates 2007-04-25, Informix 10, Java 1.6.0
>            Reporter: Patrick Linskey
>             Fix For: 0.9.8
>
>
> When running the test case from OPENJPA-228 (after a few modifications to get it working),
I get the exception included below. If I change the 'Article' mapped superclass to be named
'ArticleBase', things work.
> It looks like this is happening because multiple classes are registering for the same
alias. We should change the enhancer to not register aliases for mapped superclasses.
> Exception in thread "main" <0.0.0 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
0
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:805)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:762)
> 	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517)
> 	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:230)
> 	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:269)
> 	at nl.reinders.bm.BMTestOpenJPA.main(BMTestOpenJPA.java:41)
> 	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:585)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
> 	at org.apache.openjpa.jdbc.kernel.exps.PCPath.appendTo(PCPath.java:636)
> 	at org.apache.openjpa.jdbc.kernel.exps.FilterValueImpl.appendTo(FilterValueImpl.java:62)
> 	at org.apache.openjpa.jdbc.kernel.exps.FilterValueImpl.appendTo(FilterValueImpl.java:58)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.appendCast(DBDictionary.java:2486)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.comparison(DBDictionary.java:2443)
> 	at org.apache.openjpa.jdbc.kernel.exps.CompareExpression.appendTo(CompareExpression.java:75)
> 	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere(SelectConstructor.java:238)
> 	at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate(SelectConstructor.java:79)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects(JDBCStoreQuery.java:330)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(JDBCStoreQuery.java:169)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:677)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:985)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message