1

I saved some objects in mapdb like:

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();

After that, I changed MyClass, added/removed some fields. How can I access old objects stored in mapdb so I can convert them to new/refactored MyClass and save them again?

uylmz
  • 1,480
  • 2
  • 23
  • 44

1 Answers1

0

Simplest way is to revert changes in your class and read old data.

MapDB has Class Catalog, so it is possible to solve most issues by manipulating it (rename fields etc). But there is no official API for that yet.

Jan Kotek
  • 1,084
  • 7
  • 4
  • Can't I read data in some intermediate-raw format instead of objects? Like json, or rows-columns etc. – uylmz Nov 29 '15 at 11:43