Class SpringBatchPagingItemReaderRenderingStrategy

java.lang.Object
org.mybatis.dynamic.sql.render.RenderingStrategy
org.mybatis.dynamic.sql.render.MyBatis3RenderingStrategy
org.mybatis.dynamic.sql.util.springbatch.SpringBatchPagingItemReaderRenderingStrategy

public class SpringBatchPagingItemReaderRenderingStrategy extends MyBatis3RenderingStrategy
This rendering strategy should be used for MyBatis3 statements using the MyBatisPagingItemReader supplied by mybatis-spring integration (http://www.mybatis.org/spring/).
  • Constructor Details

    • SpringBatchPagingItemReaderRenderingStrategy

      public SpringBatchPagingItemReaderRenderingStrategy()
  • Method Details

    • getFormattedJdbcPlaceholderForPagingParameters

      public String getFormattedJdbcPlaceholderForPagingParameters(String prefix, String parameterName)
      Description copied from class: RenderingStrategy
      This method generates a binding for a parameter to a placeholder in a generated SQL statement.

      This method is used to generate bindings for limit, offset, and fetch first parameters. By default, these parameters are treated the same as any other. This method supports MyBatis Spring Batch integration where the parameter keys have predefined values and need special handling.

      Overrides:
      getFormattedJdbcPlaceholderForPagingParameters in class RenderingStrategy
      Parameters:
      prefix - parameter prefix used for locating the parameters in a SQL provider object. Typically, will be RenderingStrategy.DEFAULT_PARAMETER_PREFIX. This is ignored for Spring.
      parameterName - name of the parameter. Typically generated by calling RenderingStrategy.formatParameterMapKey(AtomicInteger)
      Returns:
      the generated binding
    • formatParameterMapKeyForFetchFirstRows

      public String formatParameterMapKeyForFetchFirstRows(AtomicInteger sequence)
      Description copied from class: RenderingStrategy
      Return a parameter map key intended as a parameter for a fetch first query.

      By default, this parameter is treated the same as any other. This method is a hook to support MyBatis Spring Batch.

      Overrides:
      formatParameterMapKeyForFetchFirstRows in class RenderingStrategy
      Parameters:
      sequence - a sequence for calculating a unique value
      Returns:
      a key used to place the parameter value in the parameter map
    • formatParameterMapKeyForLimit

      public String formatParameterMapKeyForLimit(AtomicInteger sequence)
      Description copied from class: RenderingStrategy
      Return a parameter map key intended as a parameter for a limit query.

      By default, this parameter is treated the same as any other. This method is a hook to support MyBatis Spring Batch.

      Overrides:
      formatParameterMapKeyForLimit in class RenderingStrategy
      Parameters:
      sequence - a sequence for calculating a unique value
      Returns:
      a key used to place the parameter value in the parameter map
    • formatParameterMapKeyForOffset

      public String formatParameterMapKeyForOffset(AtomicInteger sequence)
      Description copied from class: RenderingStrategy
      Return a parameter map key intended as a parameter for a query offset.

      By default, this parameter is treated the same as any other. This method is a hook to support MyBatis Spring Batch.

      Overrides:
      formatParameterMapKeyForOffset in class RenderingStrategy
      Parameters:
      sequence - a sequence for calculating a unique value
      Returns:
      a key used to place the parameter value in the parameter map