本文整理汇总了Java中org.camunda.bpm.engine.impl.db.entitymanager.operation.DbEntityOperation.getEntity方法的典型用法代码示例。如果您正苦于以下问题:Java DbEntityOperation.getEntity方法的具体用法?Java DbEntityOperation.getEntity怎么用?Java DbEntityOperation.getEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.impl.db.entitymanager.operation.DbEntityOperation
的用法示例。
在下文中一共展示了DbEntityOperation.getEntity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertEntity
import org.camunda.bpm.engine.impl.db.entitymanager.operation.DbEntityOperation; //导入方法依赖的package包/类
@Override
protected void insertEntity(DbEntityOperation operation) {
final DbEntity dbEntity = operation.getEntity();
// get statement
String insertStatement = dbSqlSessionFactory.getInsertStatement(dbEntity);
insertStatement = dbSqlSessionFactory.mapStatement(insertStatement);
ensureNotNull("no insert statement for " + dbEntity.getClass() + " in the ibatis mapping files", "insertStatement", insertStatement);
// execute the insert
executeInsertEntity(insertStatement, dbEntity);
// perform post insert actions on entity
entityInserted(dbEntity);
}
示例2: deleteEntity
import org.camunda.bpm.engine.impl.db.entitymanager.operation.DbEntityOperation; //导入方法依赖的package包/类
@Override
protected void deleteEntity(DbEntityOperation operation) {
final DbEntity dbEntity = operation.getEntity();
// get statement
String deleteStatement = dbSqlSessionFactory.getDeleteStatement(dbEntity.getClass());
ensureNotNull("no delete statement for " + dbEntity.getClass() + " in the ibatis mapping files", "deleteStatement", deleteStatement);
LOG.executeDatabaseOperation("DELETE", dbEntity);
// execute the delete
int nrOfRowsDeleted = executeDelete(deleteStatement, dbEntity);
// It only makes sense to check for optimistic locking exceptions for objects that actually have a revision
if (dbEntity instanceof HasDbRevision && nrOfRowsDeleted == 0) {
operation.setFailed(true);
return;
}
// perform post delete action
entityDeleted(dbEntity);
}
示例3: compare
import org.camunda.bpm.engine.impl.db.entitymanager.operation.DbEntityOperation; //导入方法依赖的package包/类
public int compare(DbEntityOperation firstOperation, DbEntityOperation secondOperation) {
if(firstOperation.equals(secondOperation)) {
return 0;
}
DbEntity firstEntity = firstOperation.getEntity();
DbEntity secondEntity = secondOperation.getEntity();
return firstEntity.getId().compareTo(secondEntity.getId());
}
示例4: updateEntity
import org.camunda.bpm.engine.impl.db.entitymanager.operation.DbEntityOperation; //导入方法依赖的package包/类
@Override
protected void updateEntity(DbEntityOperation operation) {
final DbEntity dbEntity = operation.getEntity();
String updateStatement = dbSqlSessionFactory.getUpdateStatement(dbEntity);
ensureNotNull("no update statement for " + dbEntity.getClass() + " in the ibatis mapping files", "updateStatement", updateStatement);
LOG.executeDatabaseOperation("UPDATE", dbEntity);
if (Context.getProcessEngineConfiguration().isJdbcBatchProcessing()) {
// execute update
executeUpdate(updateStatement, dbEntity);
} else {
// execute update
int numOfRowsUpdated = executeUpdate(updateStatement, dbEntity);
if (dbEntity instanceof HasDbRevision) {
if (numOfRowsUpdated != 1) {
// failed with optimistic locking
operation.setFailed(true);
return;
} else {
// increment revision of our copy
HasDbRevision versionedObject = (HasDbRevision) dbEntity;
versionedObject.setRevision(versionedObject.getRevisionNext());
}
}
}
// perform post update action
entityUpdated(dbEntity);
}