This class provides the processing arrangement for SimpleJdbcInsert.
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | compiled
Has this operation been compiled? |
| private final List | declaredColumns
List of column names to be used in insert statement. |
| private String[] | generatedKeyNames
The names of the columns holding the generated key. |
| private String | insertString
The generated string used for insert statement. |
| private int[] | insertTypes
The SQL type information for the insert columns. |
| private final JdbcTemplate | jdbcTemplate
Lower-level class used to execute SQL. |
| protected final Log | logger
Logger available to subclasses. |
| private final TableMetaDataContext | tableMetaDataContext
Context used to retrieve and manage database meta-data. |
| Access | Constructor and Description |
|---|---|
| protected | AbstractJdbcInsert(DataSource
the dataSource)DataSource to be usedConstructor to be used when initializing using a |
| protected | AbstractJdbcInsert(JdbcTemplate
the jdbcTemplate)JdbcTemplate to useConstructor to be used when initializing using a |
| Modifier and Type | Method and Description |
|---|---|
| protected void | checkCompiled()
Check whether this operation has been compiled already; lazily compile it if not already compiled. |
| protected void | checkIfConfigurationModificationIsAllowed()
Method to check whether we are allowed to make any configuration changes at this time. |
| public final synchronized void | |
| protected void | |
| protected int | |
| protected int | Returns: the number of rows affectedparameter names and values to be used in insert parameterSource)Delegate method that executes the insert using the passed-in |
| protected Number | Returns: the key generated by the inserta Map with parameter names and values to be used in insert args)Method that provides execution of the insert using the passed-in Map of parameters and returning a generated key. |
| protected Number | Returns: the key generated by the insertparameter names and values to be used in insert parameterSource)Method that provides execution of the insert using the passed-in
|
| protected KeyHolder | Returns: the KeyHolder containing keys generated by the inserta Map with parameter names and values to be used in insert args)Method that provides execution of the insert using the passed-in Map of parameters and returning all generated keys. |
| protected KeyHolder | Returns: the KeyHolder containing keys generated by the insertparameter names and values to be used in insert parameterSource)Method that provides execution of the insert using the passed-in
|
| protected int[] | Returns: an array of number of rows affectedmaps with parameter names and values to be used in the batch insert batch)Delegate method that executes a batch insert using the passed-in Maps of parameters. |
| protected int[] | Returns: an array of number of rows affectedparameter sources with names and values to be used in the batch insert batch)Delegate method that executes a batch insert using the passed-in
|
| private int[] | executeBatchInternal(final List<List<Object>> batchValues)
Delegate method to execute the batch insert. |
| private KeyHolder | executeInsertAndReturnKeyHolderInternal(List<?> values)
Delegate method to execute the insert, generating any number of keys. |
| private Number | executeInsertAndReturnKeyInternal(List<?> values)
Delegate method to execute the insert, generating a single key. |
| private int | |
| public String | |
| public List | |
| public String[] | |
| public String | |
| public int[] | |
| public JdbcTemplate | |
| public String | |
| public String | |
| public boolean | Returns: whether this operation is compiled and ready to useIs this operation "compiled"? |
| public boolean | |
| protected List | Returns: a List of valuesthe parameter values provided as a parameterSource)SqlParameterSourceMatch the provided in parameter values with registered parameters and parameters defined via meta-data processing. |
| protected List | Returns: a List of valuesthe parameter values provided as a Map args)Match the provided in parameter values with registered parameters and parameters defined via meta-data processing. |
| protected void | |
| private PreparedStatement | Returns: the PreparedStatementthe Connection to use con)Create a PreparedStatement to be used for an insert operation with generated keys. |
| public void | setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
Specify whether the parameter meta-data for the call should be used. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setOverrideIncludeSynonymsDefault(boolean override)
Specify whether the default for including synonyms should be changed. |
| private void | setParameterValues(PreparedStatement
the PreparedStatement preparedStatement, List<?> the values to be set values, int... columnTypes)Internal implementation for setting parameter values. |
| public void | setQuoteIdentifiers(boolean
whether identifiers should be quoted quoteIdentifiers)Specify whether SQL identifiers should be quoted. |
| public void | |
| public void |
| compiled | back to summary |
|---|---|
| private volatile boolean compiled Has this operation been compiled? Compilation means at least checking that a DataSource or JdbcTemplate has been provided. | |
| declaredColumns | back to summary |
|---|---|
| private final List<String> declaredColumns List of column names to be used in insert statement. | |
| generatedKeyNames | back to summary |
|---|---|
| private String[] generatedKeyNames The names of the columns holding the generated key. | |
| insertString | back to summary |
|---|---|
| private String insertString The generated string used for insert statement. | |
| insertTypes | back to summary |
|---|---|
| private int[] insertTypes The SQL type information for the insert columns. | |
| jdbcTemplate | back to summary |
|---|---|
| private final JdbcTemplate jdbcTemplate Lower-level class used to execute SQL. | |
| logger | back to summary |
|---|---|
| protected final Log logger Logger available to subclasses. | |
| tableMetaDataContext | back to summary |
|---|---|
| private final TableMetaDataContext tableMetaDataContext Context used to retrieve and manage database meta-data. | |
| AbstractJdbcInsert | back to summary |
|---|---|
| protected AbstractJdbcInsert(DataSource dataSource) Constructor to be used when initializing using a
| |
| AbstractJdbcInsert | back to summary |
|---|---|
| protected AbstractJdbcInsert(JdbcTemplate jdbcTemplate) Constructor to be used when initializing using a
| |
| checkCompiled | back to summary |
|---|---|
| protected void checkCompiled() Check whether this operation has been compiled already; lazily compile it if not already compiled. Automatically called by all | |
| checkIfConfigurationModificationIsAllowed | back to summary |
|---|---|
| protected void checkIfConfigurationModificationIsAllowed() Method to check whether we are allowed to make any configuration changes at this time. If the class has been compiled, then no further changes to the configuration are allowed. | |
| compile | back to summary |
|---|---|
| public final synchronized void compile() throws InvalidDataAccessApiUsageException Compile this JdbcInsert using provided parameters and meta-data plus other settings. This finalizes the configuration for this object and subsequent attempts to compile are ignored. This will be implicitly called the first time an un-compiled insert is executed.
| |
| compileInternal | back to summary |
|---|---|
| protected void compileInternal() Delegate method to perform the actual compilation. Subclasses can override this template method to perform their own compilation. Invoked after this base class's compilation is complete. | |
| doExecute | back to summary |
|---|---|
| protected int doExecute(Map<String, ?> args) Delegate method that executes the insert using the passed-in Map of parameters. | |
| doExecute | back to summary |
|---|---|
| protected int doExecute(SqlParameterSource parameterSource) Delegate method that executes the insert using the passed-in
| |
| doExecuteAndReturnKey | back to summary |
|---|---|
| protected Number doExecuteAndReturnKey(Map<String, ?> args) Method that provides execution of the insert using the passed-in Map of parameters and returning a generated key. | |
| doExecuteAndReturnKey | back to summary |
|---|---|
| protected Number doExecuteAndReturnKey(SqlParameterSource parameterSource) Method that provides execution of the insert using the passed-in
| |
| doExecuteAndReturnKeyHolder | back to summary |
|---|---|
| protected KeyHolder doExecuteAndReturnKeyHolder(Map<String, ?> args) Method that provides execution of the insert using the passed-in Map of parameters and returning all generated keys. | |
| doExecuteAndReturnKeyHolder | back to summary |
|---|---|
| protected KeyHolder doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource) Method that provides execution of the insert using the passed-in
| |
| doExecuteBatch | back to summary |
|---|---|
| protected int[] doExecuteBatch(Map<String, ?>... batch) Delegate method that executes a batch insert using the passed-in Maps of parameters.
| |
| doExecuteBatch | back to summary |
|---|---|
| protected int[] doExecuteBatch(SqlParameterSource... batch) Delegate method that executes a batch insert using the passed-in
| |
| executeBatchInternal | back to summary |
|---|---|
| private int[] executeBatchInternal(final List<List<Object>> batchValues) Delegate method to execute the batch insert. | |
| executeInsertAndReturnKeyHolderInternal | back to summary |
|---|---|
| private KeyHolder executeInsertAndReturnKeyHolderInternal(List<?> values) Delegate method to execute the insert, generating any number of keys. | |
| executeInsertAndReturnKeyInternal | back to summary |
|---|---|
| private Number executeInsertAndReturnKeyInternal(List<?> values) Delegate method to execute the insert, generating a single key. | |
| executeInsertInternal | back to summary |
|---|---|
| private int executeInsertInternal(List<?> values) Delegate method to execute the insert. | |
| getCatalogName | back to summary |
|---|---|
| public String getCatalogName() Get the name of the catalog for this insert.
| |
| getColumnNames | back to summary |
|---|---|
| public List Get the names of the columns used. | |
| getGeneratedKeyNames | back to summary |
|---|---|
| public String[] getGeneratedKeyNames() Get the names of any generated keys. | |
| getInsertString | back to summary |
|---|---|
| public String getInsertString() Get the insert string to be used. | |
| getInsertTypes | back to summary |
|---|---|
| public int[] getInsertTypes() Get the array of | |
| getJdbcTemplate | back to summary |
|---|---|
| public JdbcTemplate getJdbcTemplate() Get the configured | |
| getSchemaName | back to summary |
|---|---|
| public String getSchemaName() Get the name of the schema for this insert.
| |
| getTableName | back to summary |
|---|---|
| public String getTableName() Get the name of the table for this insert.
| |
| isCompiled | back to summary |
|---|---|
| public boolean isCompiled() Is this operation "compiled"?
| |
| isQuoteIdentifiers | back to summary |
|---|---|
| public boolean isQuoteIdentifiers() Get the
| |
| matchInParameterValuesWithInsertColumns | back to summary |
|---|---|
| protected List Match the provided in parameter values with registered parameters and parameters defined via meta-data processing.
| |
| matchInParameterValuesWithInsertColumns | back to summary |
|---|---|
| protected List Match the provided in parameter values with registered parameters and parameters defined via meta-data processing. | |
| onCompileInternal | back to summary |
|---|---|
| protected void onCompileInternal() Hook method that subclasses may override to react to compilation. This implementation is empty. | |
| prepareStatementForGeneratedKeys | back to summary |
|---|---|
| private PreparedStatement prepareStatementForGeneratedKeys(Connection con) throws SQLException Create a PreparedStatement to be used for an insert operation with generated keys.
| |
| setAccessTableColumnMetaData | back to summary |
|---|---|
| public void setAccessTableColumnMetaData(boolean accessTableColumnMetaData) Specify whether the parameter meta-data for the call should be used. The default is | |
| setCatalogName | back to summary |
|---|---|
| public void setCatalogName(String catalogName) Set the name of the catalog for this insert. | |
| setColumnNames | back to summary |
|---|---|
| public void setColumnNames(List<String> columnNames) Set the names of the columns to be used. | |
| setGeneratedKeyName | back to summary |
|---|---|
| public void setGeneratedKeyName(String generatedKeyName) Specify the name of a single generated key column. | |
| setGeneratedKeyNames | back to summary |
|---|---|
| public void setGeneratedKeyNames(String... generatedKeyNames) Set the names of any generated keys. | |
| setOverrideIncludeSynonymsDefault | back to summary |
|---|---|
| public void setOverrideIncludeSynonymsDefault(boolean override) Specify whether the default for including synonyms should be changed. The default is | |
| setParameterValues | back to summary |
|---|---|
| private void setParameterValues(PreparedStatement preparedStatement, List<?> values, int... columnTypes) throws SQLException Internal implementation for setting parameter values.
| |
| setQuoteIdentifiers | back to summary |
|---|---|
| public void setQuoteIdentifiers(boolean quoteIdentifiers) Specify whether SQL identifiers should be quoted. Defaults to
| |
| setSchemaName | back to summary |
|---|---|
| public void setSchemaName(String schemaName) Set the name of the schema for this insert. | |
| setTableName | back to summary |
|---|---|
| public void setTableName(String tableName) Set the name of the table for this insert. | |