| org.apache.cocoon.acting.modular.DatabaseAction org.apache.cocoon.acting.modular.DatabaseAddAction
DatabaseAddAction | public class DatabaseAddAction extends DatabaseAction (Code) | | Adds record in a database. The action can update one or more
tables, and can add more than one row to a table at a time. See
DatabaseAction for details.
author: Christian Haul version: CVS $Id: DatabaseAddAction.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
protected Object[][] | getColumnValues(Configuration tableConf, CacheHelper queryData, Map objectModel) Fetch all values for all columns that are needed to do the
database operation. | protected CacheHelper | getQuery(Configuration table, Map modeTypes, Map defaultModeNames) Get the String representation of the PreparedStatement. | protected boolean | honourAutoIncrement() determine whether autoincrement columns should be honoured by
this operation. | protected int | processRow(Map objectModel, Connection conn, PreparedStatement statement, String outputMode, Configuration table, CacheHelper queryData, Object[][] columnValues, int rowIndex, Map results) | protected String | selectMode(boolean isAutoIncrement, Map modes) | protected int | setKeyAuto(Configuration table, Column column, int currentIndex, int rowIndex, Connection conn, PreparedStatement statement, Map objectModel, String outputMode, Map results) Sets the key value on the prepared statement for an autoincrement type. | protected void | storeKeyValue(Configuration tableConf, Column key, int rowIndex, Connection conn, Statement statement, Map objectModel, String outputMode, Map results) Put key values into request attributes. |
getColumnValues | protected Object[][] getColumnValues(Configuration tableConf, CacheHelper queryData, Map objectModel) throws ConfigurationException, ServiceException(Code) | | Fetch all values for all columns that are needed to do the
database operation.
|
getQuery | protected CacheHelper getQuery(Configuration table, Map modeTypes, Map defaultModeNames) throws ConfigurationException, ServiceException(Code) | | Get the String representation of the PreparedStatement. This is
mapped to the Configuration object itself, so if it doesn't exist,
it will be created.
Parameters: table - the table's configuration object the insert query as a string |
honourAutoIncrement | protected boolean honourAutoIncrement()(Code) | | determine whether autoincrement columns should be honoured by
this operation. This is usually snsible only for INSERTs.
|
processRow | protected int processRow(Map objectModel, Connection conn, PreparedStatement statement, String outputMode, Configuration table, CacheHelper queryData, Object[][] columnValues, int rowIndex, Map results) throws SQLException, ConfigurationException, Exception(Code) | | set all necessary ?s and execute the query
|
selectMode | protected String selectMode(boolean isAutoIncrement, Map modes)(Code) | | determine which mode to use as default mode
here: INSERT
highly specific to operation INSERT / UPDATE / DELETE / SELECT
|
setKeyAuto | protected int setKeyAuto(Configuration table, Column column, int currentIndex, int rowIndex, Connection conn, PreparedStatement statement, Map objectModel, String outputMode, Map results) throws ConfigurationException, SQLException, Exception(Code) | | Sets the key value on the prepared statement for an autoincrement type.
Parameters: table - the table's configuration object Parameters: column - the key's configuration object Parameters: currentIndex - the position of the key column Parameters: rowIndex - the position in the current row set Parameters: conn - the database connection Parameters: statement - the insert statement Parameters: objectModel - the objectModel object Parameters: outputMode - name of the requested output module Parameters: results - sitemap result object the number of columns by which to increment the currentIndex |
storeKeyValue | protected void storeKeyValue(Configuration tableConf, Column key, int rowIndex, Connection conn, Statement statement, Map objectModel, String outputMode, Map results) throws SQLException, ConfigurationException, ServiceException(Code) | | Put key values into request attributes. Checks whether the
value needs to be retrieved from the database module first.
|
Methods inherited from org.apache.cocoon.acting.modular.DatabaseAction | public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters param) throws Exception(Code)(Java Doc) public void configure(Configuration conf) throws ConfigurationException(Code)(Java Doc) public void dispose()(Code)(Java Doc) protected void fillModes(Configuration[] conf, boolean isKey, Map defaultModeNames, Map modeTypes, CacheHelper set) throws ConfigurationException(Code)(Java Doc) protected Object[] getColumnValue(Configuration tableConf, Column column, Map objectModel) throws ConfigurationException, ServiceException(Code)(Java Doc) abstract Object[][] getColumnValues(Configuration tableConf, CacheHelper queryData, Map objectModel) throws ConfigurationException, ServiceException(Code)(Java Doc) protected DataSourceComponent getDataSource(Configuration conf, Parameters parameters) throws ServiceException(Code)(Java Doc) protected Configuration getMode(Configuration conf, String type) throws ConfigurationException(Code)(Java Doc) protected String getOutputName(Configuration tableConf, Configuration columnConf)(Code)(Java Doc) protected String getOutputName(Configuration tableConf, Configuration columnConf, int rowIndex)(Code)(Java Doc) abstract protected CacheHelper getQuery(Configuration table, Map modeTypes, Map defaultModeNames) throws ConfigurationException, ServiceException(Code)(Java Doc) abstract protected boolean honourAutoIncrement()(Code)(Java Doc) final protected boolean isLargeObject(String type)(Code)(Java Doc) abstract protected int processRow(Map objectModel, Connection conn, PreparedStatement statement, String outputMode, Configuration table, CacheHelper queryData, Object[][] columnValues, int rowIndex, Map results) throws SQLException, ConfigurationException, Exception(Code)(Java Doc) protected int processTable(Configuration table, Connection conn, Map objectModel, Map results, Map modeTypes) throws SQLException, ConfigurationException, Exception(Code)(Java Doc) abstract protected String selectMode(boolean isAutoIncrement, Map modes)(Code)(Java Doc) public void service(ServiceManager manager) throws ServiceException(Code)(Java Doc) protected void setColumn(PreparedStatement statement, int position, Configuration entry, Object value) throws Exception(Code)(Java Doc) protected void setColumn(Map objectModel, String outputMode, Map results, Configuration table, Configuration column, int rowIndex, Object value, PreparedStatement statement, int position) throws Exception(Code)(Java Doc) protected void setOutput(Map objectModel, String outputMode, Map results, Configuration table, Configuration column, int rowIndex, Object value)(Code)(Java Doc) protected void setOutputAttribute(Map objectModel, String outputMode, String key, Object value)(Code)(Java Doc)
|
|
|