开发者

GAE,can persist but cannot load(createQuery) entity

1.i able to persist entity, and in _admin , i able to see key, id/name. total 6 results. but why it not show all the property inside my entity class?

2. when i try use createQuery , i cannot load the object. there is no error in the console. the code just stuck afer hitting query.getResultList();

14:41:31,047 DEBUG [DataNucleus.Persistence] - Object Manager "org.datanucleus.ObjectManagerImpl@3328e909" opened for datastore "org.datanucleus.store.appengine.DatastoreManager@71e852be"
14:41:31,047 DEBUG [DataNucleus.Persistence] - Object Manager "org.datanucleus.ObjectManagerImpl@3328e909" opened for datastore "org.datanucleus.store.appengine.DatastoreManager@71e852be"
14:41:31,202 DEBUG [DataNucleus.Persistence] - Object Manager "org.datanucleus.ObjectManagerImpl@3328e909" closed
14:41:31,202 DEBUG [DataNucleus.Persistence] - Object Manager "org.datanucleus.ObjectManagerImpl@3328e909" closed

my dao look like

public <T> List<T> list(Class<T> entityClass) {
          //String queryStr = " from " + entityClass.getName();
          String queryStr= "select c from com.test.testing.model.Usertest c";
          Query query=entityManager.createQuery(queryStr);

          return  (List<T>) query.getResultList();
  }

what i see in _admin

 Key     ID/Name
agt0ZXN0ZXRlZnNkZnIOCxIIdXNlcnRlc3QYAQw     1
agt0ZXN0ZXRlZnNkZn开发者_如何学PythonIOCxIIdXNlcnRlc3QYAgw     2
agt0ZXN0ZXRlZnNkZnIOCxIIdXNlcnRlc3QYAww     3
agt0ZXN0ZXRlZnNkZnIOCxIIdXNlcnRlc3QYBAw     4
agt0ZXN0ZXRlZnNkZnIOCxIIdXNlcnRlc3QYBQw     5
agt0ZXN0ZXRlZnNkZnIOCxIIdXNlcnRlc3QYBgw     6
agt0ZXN0ZXRlZnNkZnIOCxIIdXNlcnRlc3QYBww     7


In the datastore viewer, you should be able to see all the properties of an entity by clicking on the link in the first column.

Sorry that I can't help with the second question; I am an Python person.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜