Total Pageviews


The name "Ybdt010" is not a recognized entity or identifier

As I do query via OpenJPA in WAS(WebSphere Application Server), it complains this error message
 org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter "select t from Ybdt010 t where t.emplCd = ?1". Error message: The name "Ybdt010" is not a recognized entity or identifier. Perhaps you meant Nigt010, which is a close match. Known entity names: [Nigw001, Nigt010, Nigt055, Nigt011, Nigt012, JUTSysParam, Nigt013, Nigt036, Nigt037, Nigt038, Nigt039, JUTMsg, Nigt080, Nigt081, Nigt082, Nigt040, Nigt063, Nigt041, Nigt042, Nigt020, Nigt064, Nigt021, Nigt043, Nigt044, Nigt088, Nigt001, Nigt045, Nigt005, Nigt006, Nigt007, Nigt008, JUTCode]   
 at org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException( ~[]   
 at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData( ~[]   
 at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData( ~[]   
 at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData( ~[]   
 at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData( ~[]   

Why it happened?
There was a problem if the first time you accessed an Entity type (ie. Ybdt010) via a Query instead of some other access.
It should be WebSphere's bug, need to install fixpack to fix this problem.

Here has a workaround solution to fix this problem. Before executing your query, you just insert something simple like...
 Ybdt010 ybdt010 = new Ybdt010();  

1 comment:

小池 said...

困擾了我好久的問題...原來只要new entity...