Google app engine 如何通过JPA在GAE datestore中设置Id字段并进行查询
我想用Long类型设置Id字段。然而,当我查询它时,我得到了这样一个例外:Google app engine 如何通过JPA在GAE datestore中设置Id字段并进行查询,google-app-engine,jpa,google-cloud-datastore,Google App Engine,Jpa,Google Cloud Datastore,我想用Long类型设置Id字段。然而,当我查询它时,我得到了这样一个例外: Cannot access field id on type 这是我对这个查询的注释 @NamedQuery(name = Q.User.FindById, query = "SELECT u FROM User u WHERE u.id = :id") }) 堆栈跟踪: org.datanucleus.exceptions.NucleusUserException: Cannot access field id o
Cannot access field id on type
这是我对这个查询的注释
@NamedQuery(name = Q.User.FindById, query = "SELECT u FROM User u WHERE u.id = :id") })
堆栈跟踪:
org.datanucleus.exceptions.NucleusUserException: Cannot access field id on type com.j.model.User
at org.datanucleus.query.compiler.JavaQueryCompiler.getType(JavaQueryCompiler.java:552)
at org.datanucleus.query.compiler.JavaQueryCompiler.getType(JavaQueryCompiler.java:529)
at org.datanucleus.query.symbol.SymbolTable.getType(SymbolTable.java:118)
at org.datanucleus.query.expression.PrimaryExpression.bind(PrimaryExpression.java:118)
at org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:85)
at org.datanucleus.query.compiler.JavaQueryCompiler.compileFilter(JavaQueryCompiler.java:299)
at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:75)
at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:246)
at org.datanucleus.store.query.Query.setImplicitParameter(Query.java:690)
at org.datanucleus.jpa.JPAQuery.setParameter(JPAQuery.java:428)
我一直在为此挖掘,一些人建议使用Key和getname。奎特,我该怎么解决呢
谢谢。发布类、其元数据和消息+堆栈跟踪是先决条件