private void dump()
throws DatabaseException {
StoreConfig storeConfig = new StoreConfig();
storeConfig.setReadOnly(true);
RawStore store = new RawStore(env, storeName, storeConfig);
EntityModel model = store.getModel();
for (String clsName : model.getKnownClasses()) {
EntityMetadata meta = model.getEntityMetadata(clsName);
if (meta != null) {
if (dumpMetadata) {
for (RawType type : model.getAllRawTypeVersions(clsName)) {
System.out.println(type);
}
} else {
PrimaryIndex<Object,RawObject> index =
store.getPrimaryIndex(clsName);
EntityCursor<RawObject> entities = index.entities();
for (RawObject entity : entities) {
System.out.println(entity);
}
entities.close();
}
}
}
store.close();
}