cn.schoolwow.quickdao.module.database.dql.response.service.DeleteFlow Maven / Gradle / Ivy
package cn.schoolwow.quickdao.module.database.dql.response.service;
import cn.schoolwow.quickdao.domain.database.parent.DatabaseType;
import cn.schoolwow.quickdao.module.database.dql.parent.domain.QueryContext;
import cn.schoolwow.quickdao.module.database.dql.response.flow.delete.DefaultDeleteStatementFlow;
import cn.schoolwow.quickdao.module.database.dql.response.flow.delete.PostgresDeleteStatementFlow;
import cn.schoolwow.quickdao.module.database.dql.response.flow.delete.SQLiteDeleteStatementFlow;
import cn.schoolwow.quickdao.module.database.dql.subCondition.domain.SubQueryOption;
import cn.schoolwow.quickdao.module.database.parent.flow.executor.ExecuteUpdateConnectionFlow;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import java.util.ArrayList;
import java.util.List;
public class DeleteFlow implements BusinessFlow {
@Override
public void executeBusinessFlow(FlowContext flowContext) throws Exception {
setStatement(flowContext);
setParameters(flowContext);
executeStatement(flowContext);
}
@Override
public String name() {
return "根据查询条件删除记录";
}
private void setStatement(FlowContext flowContext) {
DatabaseType databaseType = (DatabaseType) flowContext.checkData("databaseType");
switch (databaseType){
case SQLite:{
flowContext.executeFlowList(new SQLiteDeleteStatementFlow());
}break;
case Postgresql:{
flowContext.executeFlowList(new PostgresDeleteStatementFlow());
}break;
default:{
flowContext.executeFlowList(new DefaultDeleteStatementFlow());
}break;
}
}
private void setParameters(FlowContext flowContext) {
QueryContext queryContext = (QueryContext) flowContext.checkData("queryContext");
List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy