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


Java DbEntityOperation.getEntity方法代码示例

本文整理汇总了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);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:DbSqlSession.java

示例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);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:DbSqlSession.java

示例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());
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:12,代码来源:DbEntityOperationComparator.java

示例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);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:34,代码来源:DbSqlSession.java


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