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] Commented: (OPENJPA-228) Could not locate metadata for the class using alias
Date Wed, 25 Apr 2007 07:11:15 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491537
] 

Patrick Linskey commented on OPENJPA-228:
-----------------------------------------

I haven't run it yet, but a couple of things look suspicious:

1. You've got multiple @Entity classes called Article. The spec says that if an entity name
is not specified, the name defaults to the short name of the entity.

2. Given that you're listing your persistent types, you should also list the generated classes
as well. I think that this shouldn't be causing this problem, but it feels like it's best
practice to list all or none of the classes.

> Could not locate metadata for the class using alias
> ---------------------------------------------------
>
>                 Key: OPENJPA-228
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-228
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 0.9.6, 0.9.7
>         Environment: WindowsXP SP2 full updates 2007-04-25, Informix 10, Java 1.6.0
>            Reporter: Tom
>         Attachments: bm.zip
>
>
> 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)

-- 
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