本文整理汇总了Java中com.orientechnologies.orient.core.record.impl.ODocument.containsField方法的典型用法代码示例。如果您正苦于以下问题:Java ODocument.containsField方法的具体用法?Java ODocument.containsField怎么用?Java ODocument.containsField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.orientechnologies.orient.core.record.impl.ODocument
的用法示例。
在下文中一共展示了ODocument.containsField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteAssetNode
import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
/**
* Removes the {@link BrowseNode} associated with the given asset id.
*/
public void deleteAssetNode(final ODatabaseDocumentTx db, final EntityId assetId) {
// a given asset will only appear once in the tree
ODocument document = getFirst(
db.command(new OCommandSQL(FIND_BY_ASSET)).execute(
ImmutableMap.of(P_ASSET_ID, recordIdentity(assetId))), null);
if (document != null) {
if (document.containsField(P_COMPONENT_ID)) {
// component still exists, just remove asset details
document.removeField(P_ASSET_ID);
document.removeField(P_ASSET_NAME_LOWERCASE);
document.save();
}
else {
document.delete();
}
}
}
示例2: findComponentId
import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
@Nullable
private EntityId findComponentId(final ODocument document) {
if (document.containsField(P_COMPONENT)) {
// get the owning component from the asset, might be null if asset is standalone
return componentId(document.field(P_COMPONENT, ORID.class));
}
else {
// not an asset, must be a component itself
return componentId(document.getIdentity());
}
}