当前位置: 首页>>代码示例>>Java>>正文


Java ODatabaseDocumentTx.exists方法代码示例

本文整理汇总了Java中com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.exists方法的典型用法代码示例。如果您正苦于以下问题:Java ODatabaseDocumentTx.exists方法的具体用法?Java ODatabaseDocumentTx.exists怎么用?Java ODatabaseDocumentTx.exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx的用法示例。


在下文中一共展示了ODatabaseDocumentTx.exists方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connect

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
public OrientConnection connect() throws Exception {
    final OrientGraphFactory graphFactory = new OrientGraphFactory(url.toString(), userName, password);

    final ODatabaseDocumentTx database = graphFactory.getDatabase(false, false);
    if (database.exists()) {
        database.open(userName, password);
        database.drop();
    }

    graphFactory.setAutoStartTx(false);
    graphFactory.declareIntent(new OIntentMassiveInsert().setEnableCache(false));

    return new AbstractOrientConnection(graphFactory.getNoTx()) {
        @Override
        public void close() throws Exception {
            graph.commit();
            graph.getRawGraph().close();
        }
    };
}
 
开发者ID:gsson,项目名称:dependency-grapher,代码行数:21,代码来源:OrientDB.java

示例2: ContentStore

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
public ContentStore(final String type, String name) {
    startupIfEnginesAreMissing();
    db = new ODatabaseDocumentTx(type + ":" + name);
    boolean exists = db.exists();
    if (!exists) {
        db.create();
    }
    db = ODatabaseDocumentPool.global().acquire(type + ":" + name, "admin", "admin");
    ODatabaseRecordThreadLocal.INSTANCE.set(db);
    if (!exists) {
        updateSchema();
    }
}
 
开发者ID:ghaseminya,项目名称:jbake-rtl-jalaali,代码行数:14,代码来源:ContentStore.java

示例3: initDatabaseDocumentTx

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
private void initDatabaseDocumentTx(String database)
{
    ODatabaseDocumentTx documentTx = new ODatabaseDocumentTx(dbUrl + database);
    if (!documentTx.exists())
    {
        documentTx.create();
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:9,代码来源:RepositorySource.java

示例4: getDatabase

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
private ODatabaseDocumentTx getDatabase(String url, String userName, String password)
{
    ODatabaseDocumentTx tx = new ODatabaseDocumentTx(url);
    if (!tx.exists())
    {
        tx.create();
        return tx;
    }
    return tx.open(userName, password);
}
 
开发者ID:geekflow,项目名称:light,代码行数:11,代码来源:OtherTest.java

示例5: init

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
private static void init(String database)
{
    ODatabaseDocumentTx documentTx = new ODatabaseDocumentTx(path + database);

    if (!documentTx.exists())
    {
        documentTx.create();
        //database.open(OrientBaseGraph.ADMIN, OrientBaseGraph.ADMIN);
    }
    //        else
    //        {
    //            database.create();
    //        }
}
 
开发者ID:geekflow,项目名称:light,代码行数:15,代码来源:RepositoryFactory.java

示例6: connect

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
@Override
public ODatabaseDocumentTx connect(final String name, final boolean create) {
  checkNotNull(name);
  ensureStarted();

  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();
      log.debug("Created database: {} -> {}", name, db);

      // invoke created callback
      try {
        created(db, name);
      }
      catch (Exception e) {
        Throwables.throwIfUnchecked(e);
        throw new RuntimeException(e);
      }
    }
    else {
      log.debug("Database does not exist: {}", name);
    }
  }

  return db;
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:34,代码来源:DatabaseManagerSupport.java

示例7: createEventLogRepository

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
@Override
public boolean createEventLogRepository() {
    final ODatabaseDocumentTx db = new ODatabaseDocumentTx(eventLogRepoDBUrl);
    if (!db.exists()) {
        db.create();
        log.logp(INFO, getClass().getName(), "createEventLogRepository", String.format("created db = %s", eventLogRepoDBUrl));
        return true;
    } else {
        return false;
    }
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:12,代码来源:DemoMXBeanImpl.java

示例8: getDatabase

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
/**
 * @param create
 *            if true automatically creates database if database with given
 *            URL does not exist
 * @param open
 *            if true automatically opens the database
 */
protected ODatabaseDocumentTx getDatabase(boolean create, boolean open) {
    final ODatabaseDocumentTx db = new ODatabaseDocumentTx(url);
    if (!db.getURL().startsWith("remote:") && !db.exists()) {
        if (create)
            db.create();
        else if (open) throw new ODatabaseException("Database '" + url + "' not found");
    } else if (open) db.open(user, password);

    return db;
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:18,代码来源:OrientGraphFactory.java

示例9: exists

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
/**
 * Returns <code>true</code> if the database exists, <code>false</code>
 * otherwise.
 */
protected boolean exists(ODatabaseDocumentTx db) {
	return db.exists();
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:8,代码来源:OrientDatabase.java


注:本文中的com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。