Package com.orientechnologies.orient.core.record.impl

Examples of com.orientechnologies.orient.core.record.impl.ODocument.reload()


    doc.field("nick", "LucaPhotoTest");
    doc.field("photo", "testPhoto"); // THIS IS DECLARED TRANSIENT IN SCHEMA (see SchemaTest.java)
    doc.save();

    // RELOAD FROM THE CACHE
    doc.reload(null, false);
    Assert.assertEquals(doc.field("nick"), "LucaPhotoTest");
    Assert.assertTrue(doc.containsField("photo"));

    // RELOAD FROM DISK
    doc.reload();
View Full Code Here


    doc.reload(null, false);
    Assert.assertEquals(doc.field("nick"), "LucaPhotoTest");
    Assert.assertTrue(doc.containsField("photo"));

    // RELOAD FROM DISK
    doc.reload();
    Assert.assertEquals(doc.field("nick"), "LucaPhotoTest");
    Assert.assertFalse(doc.containsField("photo")); // THIS IS DECLARED TRANSIENT IN SCHEMA (see SchemaTest.java)

    database.close();
  }
View Full Code Here

    ODocument doc = new ODocument(database);
    doc.field("test", s);
    doc.unpin();
    doc.save();

    doc.reload(null, true);
    Assert.assertEquals(doc.field("test"), s);
  }
}
View Full Code Here

    ODocument doc = new ODocument(database);
    doc.field("binary", "Binary data".getBytes());

    doc.save();

    doc.reload();
    Assert.assertEquals(new String((byte[]) doc.field("binary", OType.BINARY)), "Binary data");

    database.close();
  }
View Full Code Here

  @Test(dependsOnMethods = "testMixedCreateExternal")
  public void testMixedReadExternal() {
    database.open("admin", "admin");

    ODocument doc = new ODocument(database, rid);
    doc.reload();

    Assert.assertEquals("Binary data", new String(((ORecordBytes) doc.field("binary")).toStream()));

    database.close();
  }
View Full Code Here

    ODocument doc2 = new ODocument(database, "Order");
    doc2.field("context", "test");
    doc2.field("date", System.currentTimeMillis());
    doc2.save();

    doc2.reload();
    Assert.assertTrue(doc2.field("date", OType.DATE) instanceof Date);

    doc2.reload();
    Assert.assertTrue(doc2.field("date", Date.class) instanceof Date);
View Full Code Here

    doc2.save();

    doc2.reload();
    Assert.assertTrue(doc2.field("date", OType.DATE) instanceof Date);

    doc2.reload();
    Assert.assertTrue(doc2.field("date", Date.class) instanceof Date);

    List<ODocument> result = database.command(
        new OSQLSynchQuery<ODocument>("select * from Order where date >= ? and context = 'test'")).execute(begin);

View Full Code Here

    doc.field("nick", "LucaPhotoTest");
    doc.field("photo", "testPhoto"); // THIS IS DECLARED TRANSIENT IN SCHEMA (see SchemaTest.java)
    doc.save();

    // RELOAD FROM THE CACHE
    doc.reload(null, false);
    Assert.assertEquals(doc.field("nick"), "LucaPhotoTest");
    Assert.assertTrue(doc.containsField("photo"));

    // RELOAD FROM DISK
    doc.reload();
View Full Code Here

    doc.reload(null, false);
    Assert.assertEquals(doc.field("nick"), "LucaPhotoTest");
    Assert.assertTrue(doc.containsField("photo"));

    // RELOAD FROM DISK
    doc.reload();
    Assert.assertEquals(doc.field("nick"), "LucaPhotoTest");
    Assert.assertFalse(doc.containsField("photo")); // THIS IS DECLARED TRANSIENT IN SCHEMA (see SchemaTest.java)

    database.close();
  }
View Full Code Here

    ODocument doc2 = new ODocument(database, "Order");
    doc2.field("context", "test");
    doc2.field("date", System.currentTimeMillis());
    doc2.save();

    doc2.reload();
    Assert.assertTrue(doc2.field("date", OType.DATE) instanceof Date);

    doc2.reload();
    Assert.assertTrue(doc2.field("date", Date.class) instanceof Date);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.