0

我正在尝试这样做:

Entity e = new Entity(_key);
e.setProperty(OBJECT, obj); 
_ds.put(e); // put to the database

但是,数据存储_ds在对象中进行了一些扩展,因此当我将 aInteger放入Entity属性时,返回的是 a Long? 这是为什么?

有没有办法在数据存储中“按原样”存储对象而不扩大或类似的东西?

4

2 回答 2

0

I thikn it's in the nature of Google App Engine to widen Integer to Long. I had this problem also. So I made:

A simple Java Map interface to the GAE Datastore. It returns just about any kind of Object, Integer, Long, etc. without "widening" or whatsoever.

于 2013-04-09T07:55:03.110 回答
0

我会向您推荐使用Objectify 框架。这是 Java App Engine 的完美框架

于 2013-04-02T09:46:16.367 回答