Google App Engine持久性中的2d或3d数组? [英] 2d or 3d array in Google App Engine persistence?
问题描述
使用JDO和Persistence,我能够成功存储ArrayList字段并稍后从类中检索它.不幸的是,如文档所述,不支持像myobject[][][]
这样的数组.我尝试了ArrayList<ArrayList<myobject>>
,但这会带来很多错误,请仔细阅读
Using JDO and Persistence, I'm able to successfully store an ArrayList field and retrieve it from a class later. Unfortunately, arrays like myobject[][][]
are not supported, as stated in documentation. I tried ArrayList<ArrayList<myobject>>
, but this gives many errors, and careful reading of the documentation would seem to suggest this may not be possible.
是否可以保留二维或更多维的数组?如果是这样,最正确的方法是什么?
Is it possible to persist an array of two or more dimensions? If so, what is the most correct way to do this?
推荐答案
如果要获取多个维度并且不打算查询其中的任何值,请使用Java序列化并将结果存储为blob.
If you want multiple dimensions and don't intend to query on any of the values therein, use Java serialization and store the result as a blob.
这篇关于Google App Engine持久性中的2d或3d数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!