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

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


    System.out.println("Using db = plocal:" + dbPath);
    File dbDir = new File(dbPath);
    System.out.println("Clean db directory for test...");
    delTree(dbDir);
    ODatabaseDocumentTx db = new ODatabaseDocumentTx("plocal:" + dbPath);
    db.create();
    db.close();

    System.out.println("Reopen it...");
    // Something was added to dbPath so the legacy situation was simulated
    dbPath += "/foo";
View Full Code Here


    System.out.println("Using db = plocal:" + dbPath);
    File dbDir = new File(dbPath);
    System.out.println("Clean db directory for test...");
    delTree(dbDir);
    ODatabaseDocumentTx db = new ODatabaseDocumentTx("plocal:" + dbPath);
    db.create();
    db.close();

    System.out.println("Reopen it...");
    db = new ODatabaseDocumentTx("plocal:" + dbPath).open("admin", "admin");
    db.drop();
View Full Code Here

    System.out.println("Using db = plocal:" + dbPath);
    File dbDir = new File(dbPath);
    System.out.println("Clean db directory for test...");
    delTree(dbDir);
    ODatabaseDocumentTx db = new ODatabaseDocumentTx("plocal:" + dbPath);
    db.create();
    db.close();

    System.out.println("Create OK!");
    db = new ODatabaseDocumentTx("plocal:" + dbPath).open("admin", "admin");
    System.out.println("Open OK!");
View Full Code Here

  public void contextConfigurationOnCreation() {
    ODatabaseDocumentTx db = new ODatabaseDocumentTx("memory:testCtxCfgOnCreate");
    Map<OGlobalConfiguration, Object> settings = new HashMap<OGlobalConfiguration, Object>();
    settings.put(OGlobalConfiguration.STORAGE_COMPRESSION_METHOD, "gzip");
    db.create(settings);
    db.close();

    ODatabaseDocumentTx db2 = new ODatabaseDocumentTx("memory:testCtxCfgOnCreate").open("admin", "admin");
    Assert.assertEquals(db2.getConfiguration().getValueAsString(OGlobalConfiguration.STORAGE_COMPRESSION_METHOD), "gzip");
  }
View Full Code Here

  }

  @Test
  public void testReload() {
    final ODatabaseDocumentTx databaseDocumentTx = new ODatabaseDocumentTx("memory:osimplekeyindexdefinitiontest");
    databaseDocumentTx.create();

    final ODocument storeDocument = simpleKeyIndexDefinition.toStream();
    storeDocument.save();

    final ODocument loadDocument = databaseDocumentTx.load(storeDocument.getIdentity());
View Full Code Here

  }

  @Test
  public void testEmptyIndexReload() {
    final ODatabaseDocumentTx database = new ODatabaseDocumentTx("memory:compositetestone");
    database.create();

    final OCompositeIndexDefinition emptyCompositeIndex = new OCompositeIndexDefinition("testClass");

    emptyCompositeIndex.addIndex(new OPropertyIndexDefinition("testClass", "fOne", OType.INTEGER));
    emptyCompositeIndex.addIndex(new OPropertyIndexDefinition("testClass", "fTwo", OType.STRING));
View Full Code Here

  }

  @Test
  public void testClassOnlyConstructor() {
    final ODatabaseDocumentTx database = new ODatabaseDocumentTx("memory:compositetesttwo");
    database.create();

    final OCompositeIndexDefinition emptyCompositeIndex = new OCompositeIndexDefinition("testClass", Arrays.asList(
        new OPropertyIndexDefinition("testClass", "fOne", OType.INTEGER), new OPropertyIndexDefinition("testClass", "fTwo",
            OType.STRING)));
View Full Code Here

    if (db.exists()) {
      db.open("admin", "admin");
      db.drop();
    }

    db.create();
    db.declareIntent(new OIntentMassiveInsert());

    ODocument document = new ODocument();
    ORidBag ridBag = new ORidBag();
    ridBag.setAutoConvertToRecord(false);
View Full Code Here

*/
@Test
public class IteratorSpeedTest {
  public void testIterationSpeed() {
    ODatabaseDocumentTx db = new ODatabaseDocumentTx("memory:speedTest");
    db.create();

    OClass oClass = db.getMetadata().getSchema().createClass("SpeedTest");
    for (int i = 0; i < 1000000; i++) {
      ODocument document = new ODocument("SpeedTest");
      document.save();
View Full Code Here

    if (database.exists()) {
      database.open("admin", "admin").drop();
    }

    database.create();

    database.getMetadata().getSchema().createClass(STUDENT_CLASS_NAME);

    database.getMetadata().getSchema().createClass(TRANSACTIONAL_WORD + STUDENT_CLASS_NAME);
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.