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

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


    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


       if (rid == null)
         throw new IllegalArgumentException("Record ID not found in request");

       ODocument doc = new ODocument(className, new ORecordId(rid));
       doc.reload(null, true);

       // BIND ALL CHANGED FIELDS
       for (Entry<String, String> f : fields.entrySet()) {
         final Object oldValue = doc.rawField(f.getKey());
         String userValue = f.getValue();
View Full Code Here

    db.command(new OCommandSQL("INSERT INTO employee SET name = 'Thierry'")).execute();
    db.command(new OCommandSQL("INSERT INTO employee SET name = 'Linn'")).execute();

    db.command(new OCommandSQL("UPDATE company ADD employees = (SELECT FROM employee)")).execute();

    r.reload();
    assertEquals(((Set) r.field("employees")).size(), 4);

    db.command(
        new OCommandSQL("UPDATE company REMOVE employees = (SELECT FROM employee WHERE name = 'Linn') WHERE name = 'MyCompany'"))
        .execute();
View Full Code Here

    db.command(
        new OCommandSQL("UPDATE company REMOVE employees = (SELECT FROM employee WHERE name = 'Linn') WHERE name = 'MyCompany'"))
        .execute();

    r.reload();
    assertEquals(((Set) r.field("employees")).size(), 3);

    db.close();
  }
}
View Full Code Here

    File testRidBagFile = new File(directory, OSBTreeCollectionManagerShared.FILE_NAME_PREFIX + clusterId
        + OSBTreeCollectionManagerShared.DEFAULT_EXTENSION);
    long testRidBagSize = testRidBagFile.length();

    for (int i = 0; i < 100; i++) {
      testDocument.reload();

      testDocument.delete();
      testDocument = crateTestDeleteDoc(realDoc);
    }
View Full Code Here

    Assert.assertFalse(document.isDirty());

    final List<String> trackedList = document.field("embeddedlist");
    trackedList.add("value2");

    document.reload();

    Assert.assertEquals(document.getDirtyFields(), new String[] {});
    Assert.assertFalse(document.isDirty());
    Assert.assertNull(document.getCollectionTimeLine("embeddedlist"));
  }
View Full Code Here

      } catch (OConcurrentModificationException e) {
        log(threadId, iCycle, dbUrl, " concurrent update against record " + doc + ", reload it and retry " + retry + "/"
            + MAX_RETRY + "...");
        if (doc != null)
          doc.reload(null, true);

      } catch (ORecordNotFoundException e) {
        log(threadId, iCycle, dbUrl, " update no item " + iSkip + " because not found");
        break;
View Full Code Here

        break;
      } catch (OConcurrentModificationException e) {
        log(threadId, iCycle, dbUrl, " concurrent delete against record " + doc + ", reload it and retry " + retry + "/"
            + MAX_RETRY + "...");
        if (doc != null)
          doc.reload(null, true);
      } catch (ORecordNotFoundException e) {
        log(threadId, iCycle, dbUrl, " delete no item " + iSkip + " because not found");
      } finally {
        db.close();
      }
View Full Code Here

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

    doc.save();

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

  @Test
  public void testBasicCreateExternal() {
View Full Code Here

  }

  @Test(dependsOnMethods = "testMixedCreateExternal")
  public void testMixedReadExternal() {
    ODocument doc = new ODocument(rid);
    doc.reload();

    Assert.assertEquals("Binary data", new String(((ORecordBytes) doc.field("binary")).toStream()));
  }
}
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.