本文整理汇总了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);
}
}
}
示例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;
}
示例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;
}
});
}
示例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);
}
}