Class SqlOperation

java.lang.Object
org.springframework.jdbc.object.RdbmsOperation
org.springframework.jdbc.object.SqlOperation
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
SqlQuery, SqlUpdate

public abstract class SqlOperation extends RdbmsOperation
Operation object representing an SQL-based operation such as a query or update, as opposed to a stored procedure.

Configures a PreparedStatementCreatorFactory based on the declared parameters.

Author:
Rod Johnson, Juergen Hoeller
  • Constructor Details

    • SqlOperation

      public SqlOperation()
  • Method Details

    • compileInternal

      protected final void compileInternal()
      Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.
      Specified by:
      compileInternal in class RdbmsOperation
    • onCompileInternal

      protected void onCompileInternal()
      Hook method that subclasses may override to post-process compilation. This implementation does nothing.
      See Also:
    • getParsedSql

      protected ParsedSql getParsedSql()
      Obtain a parsed representation of this operation's SQL statement.

      Typically used for named parameter parsing.

    • newPreparedStatementSetter

      protected final PreparedStatementSetter newPreparedStatementSetter(@Nullable Object[] params)
      Return a PreparedStatementSetter to perform an operation with the given parameters.
      Parameters:
      params - the parameter array (may be null)
    • newPreparedStatementCreator

      protected final PreparedStatementCreator newPreparedStatementCreator(@Nullable Object[] params)
      Return a PreparedStatementCreator to perform an operation with the given parameters.
      Parameters:
      params - the parameter array (may be null)
    • newPreparedStatementCreator

      protected final PreparedStatementCreator newPreparedStatementCreator(String sqlToUse, @Nullable Object[] params)
      Return a PreparedStatementCreator to perform an operation with the given parameters.
      Parameters:
      sqlToUse - the actual SQL statement to use (if different from the factory's, for example because of named parameter expanding)
      params - the parameter array (may be null)