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

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


    System.out.println("Using db = local:" + dbPath);
    File dbDir = new File(dbPath);
    System.out.println("Clean db directory for test...");
    delTree(dbDir);
    ODatabaseDocumentTx db = new ODatabaseDocumentTx("local:" + 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 = local:" + dbPath);
    File dbDir = new File(dbPath).getParentFile();
    System.out.println("Clean db directory for test...");
    delTree(dbDir);
    ODatabaseDocumentTx db = new ODatabaseDocumentTx("local:" + dbPath);
    db.create();
    db.close();

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

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

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

        f.delete();
    else
      importDir.mkdir();

    ODatabaseDocumentTx database = new ODatabaseDocumentTx("local:" + testPath + "/" + NEW_DB_URL);
    database.create();

    ODatabaseImport impor = new ODatabaseImport(database, testPath + "/" + EXPORT_FILE_PATH, this);

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

    try {
      if (OSharedDocumentDatabase.getDatabasePools().containsKey(urlParts[1]))
        throw new IllegalArgumentException("Can't create the database '" + urlParts[1] + "' because it already exists");

      db = new ODatabaseDocumentTx("local:${ORIENTDB_HOME}/databases/" + urlParts[1] + "/" + urlParts[1]);
      db.create();

    } finally {
      if (db != null)
        db.close();
    }
View Full Code Here

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

    base_db.create();

    URL_BASE = base_db.getURL();
    defaultClusterId = base_db.getDefaultClusterId();
    base_db.close();
View Full Code Here

    Assert.assertEquals(result[0], OType.STRING);
  }

  public void testEmptyIndexByKeyReload() {
    final ODatabaseDocumentTx database = new ODatabaseDocumentTx("memory:propertytest");
    database.create();

    propertyIndexByKey = new OPropertyMapIndexDefinition("tesClass", "fOne", OType.STRING, OPropertyMapIndexDefinition.INDEX_BY.KEY);

    final ODocument docToStore = propertyIndexByKey.toStream();
    database.save(docToStore);
View Full Code Here

    Assert.assertEquals(result, propertyIndexByKey);
  }

  public void testEmptyIndexByValueReload() {
    final ODatabaseDocumentTx database = new ODatabaseDocumentTx("memory:propertytest");
    database.create();

    propertyIndexByValue = new OPropertyMapIndexDefinition("tesClass", "fOne", OType.INTEGER,
        OPropertyMapIndexDefinition.INDEX_BY.VALUE);

    final ODocument docToStore = propertyIndexByValue.toStream();
View Full Code Here

         for (OStorage stg : Orient.instance().getStorages()) {
           if (stg.getName().equalsIgnoreCase(database.getName()) && stg.exists())
             throw new ODatabaseException("Database named '" + database.getName() + "' already exists: " + stg);
         }
         OLogManager.instance().info(this, "Creating database " + url);
         database.create();
         sendDatabaseInfo(iRequest, iResponse, database);
       } else {
         throw new OCommandExecutionException("The '" + storageMode + "' storage mode does not exists.");
       }
     } finally {
View Full Code Here

  }

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

    propertyIndex = new OPropertyIndexDefinition("tesClass", "fOne", OType.INTEGER);

    final ODocument docToStore = propertyIndex.toStream();
    database.save(docToStore);
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.