本文整理匯總了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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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();
}
示例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);
}