Class SqlExecutionHelperService

java.lang.Object
org.qubership.atp.mia.service.execution.SqlExecutionHelperService

@Service public class SqlExecutionHelperService extends Object
  • Field Details

    • dbExecutionRecordsLimit

      @Value("${db.execution.records.limit:50}") protected int dbExecutionRecordsLimit
  • Constructor Details

    • SqlExecutionHelperService

      public SqlExecutionHelperService()
  • Method Details

    • executeCommand

      @AtpJaegerLog public List<CommandResponse> executeCommand(String query, String system, Map<String,String> additionalParams, boolean toLimitRecords)
      Executes SQL command.
      Parameters:
      query - query or path to .sql file with queries
      system - system name
      Returns:
      CommandResponse
    • executeCommand

      public List<CommandResponse> executeCommand(@Nonnull String query, @Nonnull String system)
      Executes SQL command.
      Parameters:
      query - query or path to .sql file with queries
      system - system name
      Returns:
      CommandResponse
    • executeValidations

      @AtpJaegerLog public List<SqlResponse> executeValidations(List<Validation> validations, Command command)
      Executes validations.
    • handleSingleQuery

      @AtpJaegerLog public List<SqlResponse> handleSingleQuery(String query, Server server, boolean toLimitRecords)
      Handle single query.
      Parameters:
      query - query
      server - server
      Returns:
      Sql Response
    • getNextBillDate

      @AtpJaegerLog public String getNextBillDate()
      Get NextBillDate.
    • resetDbCache

      @AtpJaegerLog public boolean resetDbCache()
      Reset DB cashe for provided system.
      Returns:
      true if execution is OK, false otherwise
    • saveSqlTableToFile

      public void saveSqlTableToFile(List<SqlResponse> sqlResponses)
      Save sql result to file.