org.flowable.content.engine.impl.cmd.ExecuteCustomSqlCmd Maven / Gradle / Ivy
package org.flowable.content.engine.impl.cmd;
import org.flowable.content.engine.impl.util.CommandContextUtil;
import org.flowable.engine.common.impl.cmd.CustomSqlExecution;
import org.flowable.engine.common.impl.interceptor.Command;
import org.flowable.engine.common.impl.interceptor.CommandContext;
/**
* @author jbarrez
*/
public class ExecuteCustomSqlCmd implements Command {
protected Class mapperClass;
protected CustomSqlExecution customSqlExecution;
public ExecuteCustomSqlCmd(Class mapperClass, CustomSqlExecution customSqlExecution) {
this.mapperClass = mapperClass;
this.customSqlExecution = customSqlExecution;
}
@Override
public ResultType execute(CommandContext commandContext) {
Mapper mapper = CommandContextUtil.getDbSqlSession(commandContext).getSqlSession().getMapper(mapperClass);
return customSqlExecution.execute(mapper);
}
}