Top Description Fields Constructors Methods
org.springframework.jdbc.object

public abstract Class SqlOperation

extends RdbmsOperation
Class Inheritance
Known Direct Subclasses
org.springframework.jdbc.object.SqlQuery, org.springframework.jdbc.object.SqlUpdate
Imports
org.springframework.jdbc.core.PreparedStatementCreator, .PreparedStatementCreatorFactory, .PreparedStatementSetter, org.springframework.jdbc.core.namedparam.NamedParameterUtils, .ParsedSql, org.springframework.lang.Nullable, org.springframework.util.Assert

Operation object representing an SQL-based operation such as a query or update, as opposed to a stored procedure.

Configures a org.springframework.jdbc.core.PreparedStatementCreatorFactory based on the declared parameters.

Authors
Rod Johnson, Juergen Hoeller

Field Summary

Modifier and TypeField and Description
private ParsedSql
cachedSql

Parsed representation of the SQL statement.

private final Object
parsedSqlMonitor

Monitor for locking the cached representation of the parsed SQL statement.

private PreparedStatementCreatorFactory
preparedStatementFactory

Object enabling us to create PreparedStatementCreators efficiently, based on this class's declared parameters.

Inherited from org.springframework.jdbc.object.RdbmsOperation:
logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected final void
compileInternal()

Implements abstract org.springframework.jdbc.object.RdbmsOperation.compileInternal.

Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.

protected ParsedSql
getParsedSql()

Obtain a parsed representation of this operation's SQL statement.

protected final PreparedStatementCreator
newPreparedStatementCreator(Object[]
the parameter array (may be null)
params
)

Return a PreparedStatementCreator to perform an operation with the given parameters.

protected final PreparedStatementCreator
newPreparedStatementCreator(String
the actual SQL statement to use (if different from the factory's, for example because of named parameter expanding)
sqlToUse
,
Object[]
the parameter array (may be null)
params
)

Return a PreparedStatementCreator to perform an operation with the given parameters.

protected final PreparedStatementSetter
newPreparedStatementSetter(Object[]
the parameter array (may be null)
params
)

Return a PreparedStatementSetter to perform an operation with the given parameters.

protected void
onCompileInternal()

Hook method that subclasses may override to post-process compilation.

Inherited from org.springframework.jdbc.object.RdbmsOperation:
afterPropertiesSetallowsUnusedParameterscheckCompiledcompiledeclareParametergetDeclaredParametersgetGeneratedKeysColumnNamesgetJdbcTemplategetResultSetTypegetSqlisCompiledisReturnGeneratedKeysisUpdatableResultsresolveSqlsetDataSourcesetFetchSizesetGeneratedKeysColumnNamessetJdbcTemplatesetMaxRowssetParameterssetQueryTimeoutsetResultSetTypesetReturnGeneratedKeyssetSqlsetTypessetUpdatableResultssupportsLobParametersvalidateNamedParametersvalidateParameters

Field Detail

cachedSqlback to summary
private ParsedSql cachedSql

Parsed representation of the SQL statement.

Annotations
@Nullable
parsedSqlMonitorback to summary
private final Object parsedSqlMonitor

Monitor for locking the cached representation of the parsed SQL statement.

preparedStatementFactoryback to summary
private PreparedStatementCreatorFactory preparedStatementFactory

Object enabling us to create PreparedStatementCreators efficiently, based on this class's declared parameters.

Annotations
@Nullable

Constructor Detail

SqlOperationback to summary
public SqlOperation()

Method Detail

compileInternalback to summary
protected final void compileInternal()

Implements abstract org.springframework.jdbc.object.RdbmsOperation.compileInternal.

Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.

Annotations
@Override
getParsedSqlback to summary
protected ParsedSql getParsedSql()

Obtain a parsed representation of this operation's SQL statement.

Typically used for named parameter parsing.

newPreparedStatementCreatorback to summary
protected final PreparedStatementCreator newPreparedStatementCreator(Object[] params)

Return a PreparedStatementCreator to perform an operation with the given parameters.

Parameters
params:Object[]

the parameter array (may be null)

newPreparedStatementCreatorback to summary
protected final PreparedStatementCreator newPreparedStatementCreator(String sqlToUse, Object[] params)

Return a PreparedStatementCreator to perform an operation with the given parameters.

Parameters
sqlToUse:String

the actual SQL statement to use (if different from the factory's, for example because of named parameter expanding)

params:Object[]

the parameter array (may be null)

newPreparedStatementSetterback to summary
protected final PreparedStatementSetter newPreparedStatementSetter(Object[] params)

Return a PreparedStatementSetter to perform an operation with the given parameters.

Parameters
params:Object[]

the parameter array (may be null)

onCompileInternalback to summary
protected void onCompileInternal()

Hook method that subclasses may override to post-process compilation. This implementation does nothing.

See Also
compileInternal