问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/8470460/2d-or-3d-array-in-google-app-engine-persistence