@Test
public void testFetchedJson() {
Orient.instance().registerEngine(new OEngineRemote());
ODatabaseObjectTx database = new ODatabaseObjectTx(url);
database.open("admin", "admin");
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain");
List<ODocument> result = database.getUnderlying()
.command(new OSQLSynchQuery<ODocument>("select * from Profile where name = 'Barack' and surname = 'Obama'")).execute();
int i = 0;
for (ODocument doc : result) {
String jsonFull = doc.toJSON("type,rid,version,class,attribSameRow,indent:0,fetchPlan:*:-1");
ODocument loadedDoc = new ODocument().fromJSON(jsonFull);