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


Java ODocument.removeField方法代码示例

本文整理汇总了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();
    }
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:22,代码来源:BrowseNodeEntityAdapter.java

示例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();
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:21,代码来源:OrientEdge.java

示例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);
  }
}
 
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:9,代码来源:DateMapping.java

示例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;
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:8,代码来源:OrientProperty.java

示例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());
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:7,代码来源:OrientVertexProperty.java


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