Package com.orientechnologies.orient.core.db.document

Examples of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.query()


      db.rollback();
    } catch (ORecordDuplicatedException oie) {
      db.rollback();
    }

    final List<ODocument> resultAfterCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from index:idxTransactionUniqueIndexTest"));
    Assert.assertEquals(resultAfterCommit.size(), 1);
  }

  public void testTransactionUniqueIndexTestWithDotNameOne() {
View Full Code Here


    ODocument docOne = new ODocument("TransactionUniqueIndexWithDotTest");
    docOne.field("label", "A");
    docOne.save();

    final List<ODocument> resultBeforeCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from  index:TransactionUniqueIndexWithDotTest.label"));
    Assert.assertEquals(resultBeforeCommit.size(), 1);

    long countClassBefore = db.countClass("TransactionUniqueIndexWithDotTest");
    db.begin();
View Full Code Here

    Assert.assertEquals(
        ((List<ODocument>) db.command(new OCommandSQL("select from TransactionUniqueIndexWithDotTest")).execute()).size(),
        countClassBefore);

    final List<ODocument> resultAfterCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from  index:TransactionUniqueIndexWithDotTest.label"));
    Assert.assertEquals(resultAfterCommit.size(), 1);
  }

  @Test(dependsOnMethods = "testTransactionUniqueIndexTestWithDotNameOne")
View Full Code Here

      final OClass termClass = db.getMetadata().getSchema().createClass("TransactionUniqueIndexWithDotTest");
      termClass.createProperty("label", OType.STRING).createIndex(INDEX_TYPE.UNIQUE);
      db.getMetadata().getSchema().save();
    }

    final List<ODocument> resultBeforeCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from index:TransactionUniqueIndexWithDotTest.label"));
    Assert.assertEquals(resultBeforeCommit.size(), 1);

    db.begin();
View Full Code Here

      db.rollback();
    } catch (ORecordDuplicatedException oie) {
      db.rollback();
    }

    final List<ODocument> resultAfterCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from  index:TransactionUniqueIndexWithDotTest.label"));
    Assert.assertEquals(resultAfterCommit.size(), 1);
  }

  @Test(dependsOnMethods = "linkedIndexedProperty")
View Full Code Here

      document.field("val", i / 10);
      document.field("index", i);
      document.save();
    }

    final List<ODocument> result = databaseDocumentTx.query(new OSQLSynchQuery<ODocument>(
        "select from IndexWithLimitAndOffsetClass where val = 1 offset 5 limit 2"));
    Assert.assertEquals(result.size(), 2);

    for (int i = 0; i < 2; i++) {
      final ODocument document = result.get(i);
View Full Code Here

      document.save();

      rids.add(document.getIdentity());
    }

    List<ODocument> result = databaseDocumentTx.query(new OSQLSynchQuery<ODocument>(
        "select from index:IndexPaginationTest limit 5 order by key"));

    Assert.assertEquals(result.size(), 5);

    int lastKey = -1;
View Full Code Here

      Assert.assertTrue(rids.remove(document.<OIdentifiable> field("rid").getIdentity()));
    }

    while (true) {
      result = databaseDocumentTx.query(new OSQLSynchQuery<ODocument>(
          "select from index:IndexPaginationTest where key > ? limit 5  order by key"), new OCompositeKey(lastKey, lastRid));
      if (result.isEmpty())
        break;

      Assert.assertEquals(result.size(), 5);
View Full Code Here

      document.save();

      rids.add(document.getIdentity());
    }

    List<ODocument> result = databaseDocumentTx.query(new OSQLSynchQuery<ODocument>(
        "select from index:IndexPaginationTestDescOrder limit 5 order by key desc"));

    Assert.assertEquals(result.size(), 5);

    int lastKey = -1;
View Full Code Here

      Assert.assertTrue(rids.remove(document.<ORID> field("rid")));
    }

    while (true) {
      result = databaseDocumentTx.query(new OSQLSynchQuery<ODocument>(
          "select from index:IndexPaginationTestDescOrder where key < ? limit 5  order by key desc"), new OCompositeKey(lastKey,
          lastRid));
      if (result.isEmpty())
        break;
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.