Since the "productID" attribute is defined in the parent class, do I need to declare the inheritance relationship somewhere? thanks.
---------- Forwarded message ---------- From: Zhi Le Zou <[email protected]> Date: 2009/8/22 Subject: Failed to do filtered query To: [email protected] Hi there, In the local developer environment, I encountered a very strange problem with filtered query. *The "Product" and "SubProduct" class is defined like this with several simple fields:* @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Product implements Serializable{ @PrimaryKey @Persistent private String productID; @Persistent private String productName; @Persistent private float cost; @Persistent private float price; } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class SubProduct implements Serializable{ @Persistent private String color; } *The filtered query code is like this:* Query query = pm.newQuery(SubProduct.class); query.setFilter("productID == tempID"); query.declareParameters("String tempID"); Collection< SubProduct > result = (Collection< SubProduct >)query.execute(subProductInstance.getProductID()); *The exception is at bottom. It mainly says that the "productID" attribute doesn't exist. I had a look at the local admin console, and listed all instances of the SubProduct type. There is one column title named "ID/Name", whose value is same to the productID value I set. Why there is such a field there and the productID attribute is not shown? * * * *By the way, the original name of "productID" attribute is "name". Is the problem caused by this? Do I need to clear the local datastore? I am using Java AppEngine SDK, how to clear the datastore?* A million thanks in advance :-) org.datanucleus.store.exceptions.NoSuchPersistentFieldException: Field "productID" does not exist in com.todayfood.client.model.Dish or is not persistent at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:375) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:252) at com.todayfood.server.DishesServiceImpl.deleteDish(DishesServiceImpl.java:126) 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.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527) ... 27 more Caused by: org.datanucleus.store.exceptions.NoSuchPersistentFieldException: Field "productID" does not exist in com.todayfood.client.model.Dish or is not persistent at org.datanucleus.store.appengine.DatastoreTable.getMemberMapping(DatastoreTable.java:194) at org.datanucleus.store.appengine.query.DatastoreQuery.getMappingForFieldWithName(DatastoreQuery.java:936) at org.datanucleus.store.appengine.query.DatastoreQuery.addLeftPrimaryExpression(DatastoreQuery.java:830) at org.datanucleus.store.appengine.query.DatastoreQuery.addExpression(DatastoreQuery.java:681) at org.datanucleus.store.appengine.query.DatastoreQuery.addFilters(DatastoreQuery.java:629) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:207) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:85) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:31) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java:1371) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:243) ... 33 more -- Best Regards Robin (邹志乐) -- Best Regards Robin (邹志乐) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---
