Package org.springframework.batch.core.repository.dao

# Interface StepExecutionDao

All Known Implementing Classes:
  `JdbcStepExecutionDao`

public interface StepExecutionDao

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addStepExecutions(JobExecution jobExecution)`
  Retrieve all the `StepExecution` for the parent `JobExecution`.
  `default int`
  `countStepExecutions(JobInstance jobInstance, String stepName)`
  Counts all the `StepExecution` for a given step name.
  `default StepExecution`
  `getLastStepExecution(JobInstance jobInstance, String stepName)`
  Retrieve the last `StepExecution` for a given `JobInstance` ordered by starting time and then id.
  `StepExecution`
  `getStepExecution(JobExecution jobExecution, Long stepExecutionId)`
  Retrieve a `StepExecution` from its id.
  `void`
  `saveStepExecution(StepExecution stepExecution)`
  Save the given StepExecution.
  `void`
  `saveStepExecutions(Collection<StepExecution> stepExecutions)`
  Save the given collection of StepExecution as a batch.
  `void`
  `updateStepExecution(StepExecution stepExecution)`
  Update the given StepExecution Preconditions: Id must not be null.

- ## Method Details

  - ### saveStepExecution

    void saveStepExecution(StepExecution stepExecution)
    Save the given StepExecution. Preconditions: Id must be null. Postconditions: Id will be set to a unique Long.
    Parameters:
      `stepExecution` - `StepExecution` instance to be saved.

  - ### saveStepExecutions

    void saveStepExecutions(Collection<StepExecution> stepExecutions)
    Save the given collection of StepExecution as a batch. Preconditions: StepExecution Id must be null. Postconditions: StepExecution Id will be set to a unique Long.
    Parameters:
      `stepExecutions` - a collection of `JobExecution` instances to be saved.

  - ### updateStepExecution

    void updateStepExecution(StepExecution stepExecution)
    Update the given StepExecution Preconditions: Id must not be null.
    Parameters:
      `stepExecution` - `StepExecution` instance to be updated.

  - ### getStepExecution

    @Nullable StepExecution getStepExecution(JobExecution jobExecution, Long stepExecutionId)
    Retrieve a `StepExecution` from its id.
    Parameters:
      `jobExecution` - the parent `JobExecution`
      `stepExecutionId` - the step execution id
    Returns:
      a `StepExecution`

  - ### getLastStepExecution

    @Nullable default StepExecution getLastStepExecution(JobInstance jobInstance, String stepName)
    Retrieve the last `StepExecution` for a given `JobInstance` ordered by starting time and then id.
    Parameters:
      `jobInstance` - the parent `JobInstance`
      `stepName` - the name of the step
    Returns:
      a `StepExecution`

  - ### addStepExecutions

    void addStepExecutions(JobExecution jobExecution)
    Retrieve all the `StepExecution` for the parent `JobExecution`.
    Parameters:
      `jobExecution` - the parent job execution

  - ### countStepExecutions

    default int countStepExecutions(JobInstance jobInstance, String stepName)
    Counts all the `StepExecution` for a given step name.
    Parameters:
      `jobInstance` - the parent `JobInstance`
      `stepName` - the name of the step
    Returns:
      the count of `StepExecution`s for a given step
    Since:
      4.3