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

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


        }

        doc.field(f.getKey(), newValue);
      }

      doc.save();
      sendTextContent(iRequest, OHttpUtils.STATUS_OK_CODE, "OK", null, OHttpUtils.CONTENT_TEXT_PLAIN, "Record " + rid
          + " updated successfully.");
    } else if ("add".equals(operation)) {
      iRequest.data.commandInfo = "Studio create document";
View Full Code Here


      // BIND ALL CHANGED FIELDS
      for (Entry<String, String> f : fields.entrySet())
        doc.field(f.getKey(), f.getValue());

      doc.save();
      sendTextContent(iRequest, 201, "OK", null, OHttpUtils.CONTENT_TEXT_PLAIN, "Record " + doc.getIdentity()
          + " updated successfully.");

    } else if ("del".equals(operation)) {
      iRequest.data.commandInfo = "Studio delete document";
View Full Code Here

      doc.field("val4", 255);
      doc.field("val5", "this is the description for a long comic books -" + i);
      doc.field("name", "this is secmask put on top - " + i);
      doc.setClassName("Account");
      doc.setDatabase(database);
      doc.save();
      doc.reset();
      if (i % 100000 == 0) {
        double time = (double) (System.nanoTime() - block) / 1000000;
        System.out.println(i * 100 / ndoc + "%.\t" + time + "\t" + 100000.0d / time + " docs/ms");
        block = System.nanoTime();
View Full Code Here

      whiz.field("id", i);
      whiz.field("text", "This is a test");
      whiz.field("account", result.get(0).getRid());

      whiz.save();
    }

    Assert.assertEquals(idx.getSize(), 1);

    List<ODocument> indexedResult = database.getUnderlying()
View Full Code Here

    ODocument whiz = new ODocument(database.getUnderlying(), "Whiz");
    whiz.field("id", 100);
    whiz.field("text", "This is a test!");
    whiz.field("account", new ODocument(database.getUnderlying(), "Company").field("id", 9999));
    whiz.save();

    Assert.assertTrue(((ODocument) whiz.field("account")).getIdentity().isValid());

    ((ODocument) whiz.field("account")).delete();
    whiz.delete();
View Full Code Here

    // Create docA.
    ODocument vDocA_db1 = database1.newInstance();
    vDocA_db1.field(NAME, "docA");
    vDocA_db1.unpin();
    vDocA_db1.save();

    // Keep the IDs.
    ORID vDocA_Rid = vDocA_db1.getIdentity().copy();

    database2.begin(TXTYPE.OPTIMISTIC);
View Full Code Here

    database2.begin(TXTYPE.OPTIMISTIC);
    try {
      // Get docA and update in db2 transaction context
      ODocument vDocA_db2 = database2.load(vDocA_Rid);
      vDocA_db2.field(NAME, "docA_v2");
      vDocA_db2.save();

      database1.begin(TXTYPE.OPTIMISTIC);
      try {
        vDocA_db1.field(NAME, "docA_v3");
        vDocA_db1.save();
View Full Code Here

    database1.getLevel2Cache().setStrategy(STRATEGY.COPY_RECORD);

    // Create docA.
    ODocument vDocA_db1 = database1.newInstance();
    vDocA_db1.field(NAME, "docA");
    vDocA_db1.save();

    // Keep the IDs.
    ORID vDocA_Rid = vDocA_db1.getIdentity().copy();

    database2.begin(TXTYPE.OPTIMISTIC);
View Full Code Here

    database2.begin(TXTYPE.OPTIMISTIC);
    try {
      // Get docA and update in db2 transaction context
      ODocument vDocA_db2 = database2.load(vDocA_Rid);
      vDocA_db2.field(NAME, "docA_v2");
      vDocA_db2.save();

      database1.begin(TXTYPE.OPTIMISTIC);
      try {
        vDocA_db1.field(NAME, "docA_v3");
        vDocA_db1.save();
View Full Code Here

    // Create docA in db1
    database1.begin(TXTYPE.OPTIMISTIC);
    ODocument vDocA_db1 = database1.newInstance();
    vDocA_db1.field(NAME, "docA");
    vDocA_db1.save();
    database1.commit();

    // Keep the ID.
    ORID vDocA_Rid = vDocA_db1.getIdentity().copy();
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.