Examples of countClass()


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

  }

  private long printStats(final String databaseUrl) {
    final ODatabaseDocumentTx database = ODatabaseDocumentPool.global().acquire(databaseUrl, "admin", "admin");
    try {
      long total = database.countClass("Person");
      List<ODocument> result = database.query(new OSQLSynchQuery<OIdentifiable>("select count(*) from Person"));

      final String name = database.getURL();

      System.out.println("\nReader " + name + " sql count: " + result.get(0) + " counting class: " + total + " counting cluster: "
View Full Code Here

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

    try {
      List<ODocument> result = database.query(new OSQLSynchQuery<OIdentifiable>("select count(*) from Person"));

      final String name = database.getURL();

      System.out.println("\nReader " + name + " sql count: " + result.get(0) + " counting class: " + database.countClass("Person")
          + " counting cluster: " + database.countClusterElements("Person"));

      if (database.getMetadata().getSchema().existsClass("ODistributedConflict"))
        try {
          List<ODocument> conflicts = database
View Full Code Here

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

    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();
    try {
      ODocument docTwo = new ODocument("TransactionUniqueIndexWithDotTest");
      docTwo.field("label", "A");
      docTwo.save();
View Full Code Here

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

  @Test
  public void deleteInPool() {
    ODatabaseDocumentTx db = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");

    final Long total = db.countClass("Profile");

    final List<ODocument> resultset = db.query(new OSQLSynchQuery<Object>(
        "select from Profile where sex = 'male' and salary > 120 and salary <= 133"));

    final Number records = (Number) db.command(
View Full Code Here

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

    final Number records = (Number) db.command(
        new OCommandSQL("delete from Profile where sex = 'male' and salary > 120 and salary <= 133")).execute();

    Assert.assertEquals(records.intValue(), resultset.size());

    Assert.assertEquals(db.countClass("Profile"), total - records.intValue());

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

Examples of com.orientechnologies.orient.object.db.OObjectDatabaseTx.countClass()

      // create database if does not exist
      OObjectDatabaseTx database = new OObjectDatabaseTx("plocal:" + System.getProperty("ORIENTDB_HOME") + "/test-db");
      if (!database.exists())
        database.create();
      database.open("admin", "admin");
      database.countClass("ouser");
      database.close();
      server.shutdown();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.object.db.OObjectDatabaseTx.countClass()

        OObjectDatabaseTx db = ODB.openObjectDB();
        Item item = new Item();
        item.description = "Description";
        item.name = "Item578";
        db.save(item);
        assertEquals(1, db.countClass(Item.class));
        for (Item it : db.browseClass(Item.class)) {
            assertNotNull(db.getIdentity(it).toString());
            assertEquals("Item578", it.name);
            db.delete(it);
        }
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.