我在 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 并再次保存它们?