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


Java ODocument.getSchemaClass方法代码示例

本文整理汇总了Java中com.orientechnologies.orient.core.record.impl.ODocument.getSchemaClass方法的典型用法代码示例。如果您正苦于以下问题:Java ODocument.getSchemaClass方法的具体用法?Java ODocument.getSchemaClass怎么用?Java ODocument.getSchemaClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.orientechnologies.orient.core.record.impl.ODocument的用法示例。


在下文中一共展示了ODocument.getSchemaClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: recordEvent

import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
private boolean recordEvent(final ODocument document, final EventKind eventKind) {
  final OClass schemaType = document.getSchemaClass();
  if (schemaType != null) {
    final EntityAdapter adapter = recordingAdapters.get(schemaType);
    if (adapter != null) {
      final ODatabaseInternal db = ODatabaseRecordThreadLocal.INSTANCE.get();
      if (db != null) {
        // workaround OrientDB 2.1 issue where in-TX dictionary updates are not replicated
        if (db.getStorage().isDistributed() && adapter instanceof SingletonEntityAdapter) {
          ((SingletonEntityAdapter) adapter).singleton.replicate(document, eventKind);
        }
        Map<ODocument, EventKind> events = dbEvents.get(db);
        if (events == null) {
          events = new LinkedHashMap<>();
          dbEvents.put(db, events);
        }
        // replace mapping after merge so key always points to the latest document instance
        // (avoids a risk that the original key became disconnected/detached at this point)
        EventKind updatedEventKind = updateEventKind(events.remove(document), eventKind);
        if (updatedEventKind != null) {
          events.put(document, updatedEventKind);
        }
        return true;
      }
    }
  }
  return false;
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:29,代码来源:EntityHook.java

示例2: onRecordBeforeUpdate

import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
@Override
public RESULT onRecordBeforeUpdate(final ODocument doc) {
    if (doc.getSchemaClass() != null && doc.getSchemaClass().isSubClassOf(TIMESTAMPED_CLASS)) {
        doc.field(Timestamped.Field.updated_on.name(), System.currentTimeMillis());
        return RESULT.RECORD_CHANGED;
    }
    return RESULT.RECORD_NOT_CHANGED;
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:9,代码来源:SetCreatedOnAndUpdatedOn.java

示例3: onRecordBeforeCreate

import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
@Override
public RESULT onRecordBeforeCreate(final ODocument doc) {
    if (doc.getSchemaClass() != null && doc.getSchemaClass().isSubClassOf(TIMESTAMPED_CLASS)) {
        final long createdOn = System.currentTimeMillis();
        doc.field(Timestamped.Field.created_on.name(), createdOn);
        doc.field(Timestamped.Field.updated_on.name(), createdOn);
        return RESULT.RECORD_CHANGED;
    }
    return RESULT.RECORD_NOT_CHANGED;
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:11,代码来源:SetCreatedOnAndUpdatedOn.java


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