本文整理汇总了Java中com.orientechnologies.orient.core.record.impl.ODocument.removeField方法的典型用法代码示例。如果您正苦于以下问题:Java ODocument.removeField方法的具体用法?Java ODocument.removeField怎么用?Java ODocument.removeField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.orientechnologies.orient.core.record.impl.ODocument
的用法示例。
在下文中一共展示了ODocument.removeField方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: removeLink
import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void removeLink(Direction direction) {
final String fieldName = OrientVertex.getConnectionFieldName(direction, this.label());
ODocument doc = this.getVertex(direction).getRawDocument();
Object found = doc.field(fieldName);
if (found == null)
//already removed
return;
if (found instanceof ORidBag) {
ORidBag bag = (ORidBag) found;
bag.remove(this.getRawElement());
if (bag.size() == 0) doc.removeField(fieldName);
} else if (found instanceof Collection<?>) {
((Collection<Object>) found).remove(this.getRawElement());
if (((Collection<Object>) found).size() == 0) doc.removeField(fieldName);
} else
throw new IllegalStateException("Relationship content is invalid on field " + fieldName + ". Found: " + found);
doc.save();
}
示例3: afterWorkItem
import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
@Override
public void afterWorkItem(ODocument doc) {
if (date != null) {
doc.field(fieldName, date);
} else {
doc.removeField(fieldName);
}
}
示例4: remove
import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
@Override
public void remove() {
ODocument doc = element.getRawDocument();
doc.removeField(key);
doc.save();
this.value = null;
}
示例5: removeMetadata
import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
public void removeMetadata(String key) {
ODocument metadata = getMetadataDocument();
metadata.removeField(key);
if (metadata.fields() == 0)
element.getRawDocument().removeField(metadataKey());
}