| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.jdbc.core.simple.AbstractJdbcInsert
public abstract class AbstractJdbcInsert
Abstract class to provide base functionality for easy inserts
 based on configuration options and database metadata.
 This class provides the base SPI for SimpleJdbcInsert.
| Field Summary | |
|---|---|
| protected  Log | loggerLogger available to subclasses | 
| Constructor Summary | |
|---|---|
| protected  | AbstractJdbcInsert(DataSource dataSource)Constructor for sublasses to delegate to for setting the DataSource. | 
| protected  | AbstractJdbcInsert(JdbcTemplate jdbcTemplate)Constructor for sublasses to delegate to for setting the JdbcTemplate. | 
| Method Summary | |
|---|---|
| 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 allowd to make any configuration changes at this time. | 
|  void | compile()Compile this JdbcInsert using provided parameters and meta data plus other settings. | 
| protected  void | compileInternal()Method to perform the actual compilation. | 
| protected  int | doExecute(Map<String,Object> args)Method that provides execution of the insert using the passed in Map of parameters | 
| protected  int | doExecute(SqlParameterSource parameterSource)Method that provides execution of the insert using the passed in SqlParameterSource | 
| protected  Number | doExecuteAndReturnKey(Map<String,Object> args)Method that provides execution of the insert using the passed in Map of parameters and returning a generated key | 
| protected  Number | doExecuteAndReturnKey(SqlParameterSource parameterSource)Method that provides execution of the insert using the passed in SqlParameterSourceand returning a generated key | 
| protected  KeyHolder | doExecuteAndReturnKeyHolder(Map<String,Object> args)Method that provides execution of the insert using the passed in Map of parameters and returning all generated keys | 
| protected  KeyHolder | doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource)Method that provides execution of the insert using the passed in SqlParameterSourceand returning all generated keys | 
| protected  int[] | doExecuteBatch(Map<String,Object>[] batch)Method that provides execution of a batch insert using the passed in Maps of parameters | 
| protected  int[] | doExecuteBatch(SqlParameterSource[] batch)Method that provides execution of a batch insert using the passed in array of SqlParameterSource | 
|  String | getCatalogName()Get the name of the catalog for this insert | 
|  List<String> | getColumnNames()Get the names of the columns used | 
|  String[] | getGeneratedKeyNames()Get the names of any generated keys | 
|  String | getInsertString()Get the insert string to be used | 
|  int[] | getInsertTypes()Get the array of Typesto be used for insert | 
| protected  JdbcTemplate | getJdbcTemplate()Get the JdbcTemplatethat is configured to be used | 
|  String | getSchemaName()Get the name of the schema for this insert | 
|  String | getTableName()Get the name of the table for this insert | 
|  boolean | isCompiled()Is this operation "compiled"? | 
| protected  List<Object> | matchInParameterValuesWithInsertColumns(Map<String,Object> args)Match the provided in parameter values with regitered parameters and parameters defined via metedata processing. | 
| protected  List<Object> | matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)Match the provided in parameter values with regitered parameters and parameters defined via metedata processing. | 
| protected  void | onCompileInternal()Hook method that subclasses may override to react to compilation. | 
|  void | setCatalogName(String catalogName)Set the name of the catalog for this insert | 
|  void | setColumnNames(List<String> columnNames)Set the names of the columns to be used | 
|  void | setGeneratedKeyName(String generatedKeyName)Specify the name of a single generated key column | 
|  void | setGeneratedKeyNames(String[] generatedKeyNames)Set the names of any generated keys | 
|  void | setSchemaName(String schemaName)Set the name of the schema for this insert | 
|  void | setTableName(String tableName)Set the name of the table for this insert | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected final Log logger
| Constructor Detail | 
|---|
protected AbstractJdbcInsert(DataSource dataSource)
protected AbstractJdbcInsert(JdbcTemplate jdbcTemplate)
| Method Detail | 
|---|
public String getTableName()
public void setTableName(String tableName)
public String getSchemaName()
public void setSchemaName(String schemaName)
public String getCatalogName()
public void setCatalogName(String catalogName)
public void setColumnNames(List<String> columnNames)
public List<String> getColumnNames()
public String[] getGeneratedKeyNames()
public void setGeneratedKeyNames(String[] generatedKeyNames)
public void setGeneratedKeyName(String generatedKeyName)
public String getInsertString()
public int[] getInsertTypes()
Types to be used for insert
protected JdbcTemplate getJdbcTemplate()
JdbcTemplate that is configured to be used
public final void compile()
                   throws InvalidDataAccessApiUsageException
InvalidDataAccessApiUsageException - if the object hasn't
 been correctly initialized, for example if no DataSource has been providedprotected void compileInternal()
protected void onCompileInternal()
public boolean isCompiled()
protected void checkCompiled()
Automatically called by validateParameters.
protected void checkIfConfigurationModificationIsAllowed()
protected int doExecute(Map<String,Object> args)
args - Map with parameter names and values to be used in insert
protected int doExecute(SqlParameterSource parameterSource)
SqlParameterSource
parameterSource - parameter names and values to be used in insert
protected Number doExecuteAndReturnKey(Map<String,Object> args)
args - Map with parameter names and values to be used in insert
protected Number doExecuteAndReturnKey(SqlParameterSource parameterSource)
SqlParameterSource
 and returning a generated key
parameterSource - parameter names and values to be used in insert
protected KeyHolder doExecuteAndReturnKeyHolder(Map<String,Object> args)
args - Map with parameter names and values to be used in insert
protected KeyHolder doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource)
SqlParameterSource
 and returning all generated keys
parameterSource - parameter names and values to be used in insert
protected int[] doExecuteBatch(Map<String,Object>[] batch)
batch - array of Maps with parameter names and values to be used in batch insert
protected int[] doExecuteBatch(SqlParameterSource[] batch)
SqlParameterSource
batch - array of SqlParameterSource with parameter names and values to be used in insert
protected List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
parameterSource - the parameter vakues provided as a SqlParameterSource
protected List<Object> matchInParameterValuesWithInsertColumns(Map<String,Object> args)
args - the parameter values provided in a Map
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||