【发布时间】:2015-11-29 17:34:47
【问题描述】:
我在 mapdb 中保存了一些对象,例如:
import org.mapdb.*;
//open (or create) database
File file = new File(“dbFileName”);
DB db = DBMaker
.newFileDB(file)
.make();
//use map
Map<Integer, MyClass> map = db.hashMap(“mapName”);
map.put(1, myClassInstance);
//commit and close database
db.commit();
db.close();
之后,我更改了 MyClass,添加/删除了一些字段。如何访问存储在 mapdb 中的旧对象,以便将它们转换为新的/重构的 MyClass 并再次保存?
【问题讨论】:
标签: mapdb