當前位置: 首頁>>代碼示例>>Java>>正文


Java ODictionary類代碼示例

本文整理匯總了Java中com.orientechnologies.orient.core.dictionary.ODictionary的典型用法代碼示例。如果您正苦於以下問題:Java ODictionary類的具體用法?Java ODictionary怎麽用?Java ODictionary使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ODictionary類屬於com.orientechnologies.orient.core.dictionary包,在下文中一共展示了ODictionary類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: set

import com.orientechnologies.orient.core.dictionary.ODictionary; //導入依賴的package包/類
/**
 * Set singleton entity.  Returns {@code true} if entity was replaced.
 */
public boolean set(final ODatabaseDocumentTx db, final T entity) {
  checkNotNull(db);
  checkNotNull(entity);

  ODictionary<ORecord> dictionary = db.getDictionary();
  ODocument document = dictionary.get(key);
  if (document == null) {
    document = adapter.addEntity(db, entity);
    dictionary.put(key, document);
    return false;
  }
  else {
    adapter.writeEntity(document, entity);
    return true;
  }
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:20,代碼來源:SingletonActions.java

示例2: get

import com.orientechnologies.orient.core.dictionary.ODictionary; //導入依賴的package包/類
/**
 * Get singleton entity or {@code null} if entity was not found.
 */
@Nullable
public T get(final ODatabaseDocumentTx db) {
  checkNotNull(db);

  ODictionary<ORecord> dictionary = db.getDictionary();
  ODocument document = dictionary.get(key);
  if (document != null) {
    return adapter.readEntity(document);
  }
  return null;
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:15,代碼來源:SingletonActions.java

示例3: delete

import com.orientechnologies.orient.core.dictionary.ODictionary; //導入依賴的package包/類
/**
 * Delete singleton entity.  Returns {@code true} if entity was deleted.
 */
public boolean delete(final ODatabaseDocumentTx db) {
  checkNotNull(db);

  ODictionary<ORecord> dictionary = db.getDictionary();
  ODocument document = dictionary.get(key);
  if (document != null) {
    db.delete(document);
    dictionary.remove(key);
    return true;
  }
  return false;
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:16,代碼來源:SingletonActions.java

示例4: replicate

import com.orientechnologies.orient.core.dictionary.ODictionary; //導入依賴的package包/類
/**
 * TEMP: workaround OrientDB 2.1 issue where in-TX dictionary updates are not replicated.
 *
 * @since 3.1
 */
public void replicate(final ODocument document, final EventKind eventKind) {
  ODictionary<ORecord> dictionary = document.getDatabase().getDictionary();
  switch (eventKind) {
    case CREATE:
    case UPDATE:
      dictionary.put(key, document);
      break;
    case DELETE:
      dictionary.remove(key);
      break;
    default:
      break;
  }
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:20,代碼來源:SingletonActions.java

示例5: copySquenceId

import com.orientechnologies.orient.core.dictionary.ODictionary; //導入依賴的package包/類
private void copySquenceId() {
       destConn.activateOnCurrentThread();

       ODocument vdoc = new ODocument();
       vdoc = vdoc.field("f1", seqId).save();
       ODictionary dictionary = destConn.getDictionary();
       dictionary.put("NdexSeq", vdoc);
   	destConn.commit();
       
}
 
開發者ID:ndexbio,項目名稱:ndex-common,代碼行數:11,代碼來源:Migrator1_2to1_3.java

示例6: Migrator1_2to1_3

import com.orientechnologies.orient.core.dictionary.ODictionary; //導入依賴的package包/類
public Migrator1_2to1_3(String srcPath) throws NdexException, SolrServerException, IOException {
	
	NetworkGlobalIndexManager mgr = new NetworkGlobalIndexManager();
	mgr.createCoreIfNotExists();
	
	srcDbPath = "plocal:" + srcPath;
	
	OGlobalConfiguration.USE_WAL.setValue(false);
	OGlobalConfiguration.WAL_SYNC_ON_PAGE_FLUSH.setValue(false);
	
	srcPool = new OPartitionedDatabasePool(srcDbPath , "admin","admin",5);

	srcConnection = srcPool.acquire();
	
	ODictionary srcDictionary = srcConnection.getDictionary();
	ODocument vd = (ODocument) srcDictionary.get("NdexSeq");
	seqId = vd.field("f1");
	
	Configuration configuration = Configuration.getInstance();
	targetDB = NdexDatabase.createNdexDatabase( configuration.getHostURI(),
			configuration.getDBURL(),
   			configuration.getDBUser(),
   			configuration.getDBPasswd(), 5);
	
	destConn = targetDB.getAConnection();
	
	graph = new OrientGraph(destConn,false);
	graph.setAutoScaleEdgeType(true);
	graph.setEdgeContainerEmbedded2TreeThreshold(40);
	graph.setUseLightweightEdges(true);
	
	networkDao = new BasicNetworkDAO ( destConn);
	
	dbDao = new NetworkDocDAO ( destConn);

}
 
開發者ID:ndexbio,項目名稱:ndex-common,代碼行數:37,代碼來源:Migrator1_2to1_3.java


注:本文中的com.orientechnologies.orient.core.dictionary.ODictionary類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。