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

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


  }

  @Test
  public void testRenameClass() {
    ODatabaseDocumentTx databaseDocumentTx = new ODatabaseDocumentTx(url);
    databaseDocumentTx.open("admin", "admin");

    OClass oClass = databaseDocumentTx.getMetadata().getSchema().createClass("RenameClassTest");

    ODocument document = new ODocument("RenameClassTest");
    document.save();
View Full Code Here


    Assert.assertEquals(result.size(), 2);
  }

  public void testMinimumClustersAndClusterSelection() {
    ODatabaseDocumentTx databaseDocumentTx = new ODatabaseDocumentTx(url);
    databaseDocumentTx.open("admin", "admin");

    databaseDocumentTx.command(new OCommandSQL("alter database minimumclusters 3")).execute();

    try {
      databaseDocumentTx.command(new OCommandSQL("create class multipleclusters")).execute();
View Full Code Here

    try {
      databaseDocumentTx.command(new OCommandSQL("create class multipleclusters")).execute();

      databaseDocumentTx.close();

      databaseDocumentTx.open("admin", "admin");
      databaseDocumentTx.reload();

      Assert.assertFalse(databaseDocumentTx.existsCluster("multipleclusters"));

      for (int i = 0; i < 3; ++i) {
View Full Code Here

    }
  }

  public void testExchangeCluster() {
    ODatabaseDocumentTx databaseDocumentTx = new ODatabaseDocumentTx(url);
    databaseDocumentTx.open("admin", "admin");

    try {
      databaseDocumentTx.command(new OCommandSQL("CREATE CLASS TestRenameClusterOriginal")).execute();

      swapClusters(databaseDocumentTx, 1);
View Full Code Here

    if (!db.exists())
      db.create();

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

    ODatabaseHelper.dropDatabase(db, getStorageType());

    Assert.assertFalse(new File(testPath + "/" + DbImportExportTest.NEW_DB_PATH).exists());
View Full Code Here

    if (!db.exists())
      db.create();

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

      db.drop();
      db.create();
    }
View Full Code Here

    database = new OObjectDatabaseTx(url + "_objectschema");
    ODatabaseHelper.createDatabase(database, url + "_objectschema", getStorageType());
    database.close();
    try {
      ODatabaseDocumentTx exportDatabase = new ODatabaseDocumentTx(url);
      exportDatabase.open("admin", "admin");

      OCommandOutputListener listener = new OCommandOutputListener() {
        @Override
        public void onMessage(String iText) {
View Full Code Here

      ODatabaseExport export = new ODatabaseExport(exportDatabase, EXPORT_DIR, listener);
      export.exportDatabase();
      export.close();
      exportDatabase.close();
      ODatabaseDocumentTx importDatabase = new ODatabaseDocumentTx(url + "_objectschema");
      importDatabase.open("admin", "admin");
      ODatabaseImport impor = new ODatabaseImport(importDatabase, EXPORT_DIR, listener);

      // UNREGISTER ALL THE HOOKS
      for (ORecordHook hook : new ArrayList<ORecordHook>(importDatabase.getHooks().keySet())) {
        importDatabase.unregisterHook(hook);
View Full Code Here

    String uri = connectionUri(name);
    ODatabaseDocumentTx db = new ODatabaseDocumentTx(uri);

    if (db.exists()) {
      db.open(SYSTEM_USER, SYSTEM_PASSWORD);
      log.debug("Opened database: {} -> {}", name, db);
    }
    else {
      if (create) {
        db.create();
View Full Code Here

    }
    String databaseName=BBConfiguration.getDBDir();
    if (Logger.isDebugEnabled()) Logger.debug("opening connection on db: " + databaseName + " for " + username);
   
    ODatabaseDocumentTx conn = new ODatabaseDocumentTx("plocal:" + BBConfiguration.getDBDir());
    conn.open(username,password);
    HooksManager.registerAll(getConnection());
   
    DbHelper.appcode.set(appcode);
    DbHelper.username.set(username);
    DbHelper.password.set(password);
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.