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


Java ORecordOperation类代码示例

本文整理汇总了Java中com.orientechnologies.orient.core.db.record.ORecordOperation的典型用法代码示例。如果您正苦于以下问题:Java ORecordOperation类的具体用法?Java ORecordOperation怎么用?Java ORecordOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ORecordOperation类属于com.orientechnologies.orient.core.db.record包,在下文中一共展示了ORecordOperation类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConfigure

import com.orientechnologies.orient.core.db.record.ORecordOperation; //导入依赖的package包/类
@Override
public void onConfigure(Component component) {
	super.onConfigure(component);
	Object object = component.getDefaultModelObject();
	if(object!=null && object instanceof OIdentifiable) {
		ORID rid = ((OIdentifiable)object).getIdentity();
		if(rid.isPersistent()) {
			component.setEnabled(true);
		} else {
			// Is record scheduled for creation?
			OTransaction transaction = OrientDbWebSession.get().getDatabase().getTransaction();
			ORecordOperation operation = transaction.getRecordEntry(rid);
			component.setEnabled(operation!=null && operation.type==ORecordOperation.CREATED);
		}
	}
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:17,代码来源:DisableIfDocumentNotSavedBehavior.java

示例2: onRecordBeforeDelete

import com.orientechnologies.orient.core.db.record.ORecordOperation; //导入依赖的package包/类
@Override
public RESULT onRecordBeforeDelete(final ODocument iDocument) {
  final ORecordVersion version = iDocument.getRecordVersion(); // Cache the transaction-provided value
  if (iDocument.fields() == 0) {
    // FORCE LOADING OF CLASS+FIELDS TO USE IT AFTER ON onRecordAfterDelete METHOD
    iDocument.reload();
    if (version.getCounter() > -1 && iDocument.getRecordVersion().compareTo(version) != 0) // check for record version errors
      if (OFastConcurrentModificationException.enabled())
        throw OFastConcurrentModificationException.instance();
      else
        throw new OConcurrentModificationException(iDocument.getIdentity(), iDocument.getRecordVersion(), version,
            ORecordOperation.DELETED);
  }

  return RESULT.RECORD_NOT_CHANGED;
}
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:17,代码来源:OLuceneClassIndexManager.java

示例3: onLiveResult

import com.orientechnologies.orient.core.db.record.ORecordOperation; //导入依赖的package包/类
@Override
public void onLiveResult(final int iLiveToken, final ORecordOperation iOp) throws OException {
    // wrapping in external transaction (live query thread will always have thread bound connection)
    context.doInTransaction(TxConfig.external(), new TxAction<Void>() {
        @Override
        public Void execute() throws Throwable {
            underlying.onLiveResult(iLiveToken, iOp);
            return null;
        }
    });
}
 
开发者ID:xvik,项目名称:guice-persist-orient,代码行数:12,代码来源:TransactionalLiveAdapter.java

示例4: onLiveResult

import com.orientechnologies.orient.core.db.record.ORecordOperation; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onLiveResult(final int iLiveToken, final ORecordOperation iOp) throws OException {
    final RecordOperation op = RecordOperation.forType(iOp.type);
    final ORecord rec = iOp.getRecord();
    try {
        listener.onLiveResult(iLiveToken, op, converter.convert(rec, targetType));
    } catch (Exception th) {
        final StringBuilder id = new StringBuilder(
                rec instanceof ODocument ? ((ODocument) rec).getClassName() : rec.getClass().getSimpleName()
        ).append("(").append(rec.getIdentity()).append(")");
        throw new LiveResultMappingException(
                "Error calling live result listener " + iLiveToken + " for " + op + " record " + id, th);
    }
}
 
开发者ID:xvik,项目名称:guice-persist-orient,代码行数:16,代码来源:LiveResultMapper.java


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