com.scooterframework.orm.sqldataexpress.processor
Class DataProcessorImpl

java.lang.Object
  extended by com.scooterframework.orm.sqldataexpress.processor.DataProcessorImpl
All Implemented Interfaces:
DataProcessor
Direct Known Subclasses:
JdbcStatementProcessor, StoredProcedureProcessor

public abstract class DataProcessorImpl
extends java.lang.Object
implements DataProcessor

DataProcessorImpl class.


Field Summary
protected  java.sql.DatabaseMetaData dbmd
           
 
Fields inherited from interface com.scooterframework.orm.sqldataexpress.processor.DataProcessor
DEFAULT_PAGINATION_LIMIT, framework_input_key_prefix, input_key_database_connection_context, input_key_database_connection_name, input_key_max_row_index, input_key_min_row_index, input_key_records_fixed, input_key_records_limit, input_key_records_offset, input_key_use_pagination, NO_ROW_LIMIT
 
Constructor Summary
DataProcessorImpl()
           
 
Method Summary
protected  java.math.BigDecimal convert2BigDecimal(java.lang.Object obj, Parameter p)
           
protected  double convert2double(java.lang.Object obj, Parameter p)
           
protected  float convert2float(java.lang.Object obj, Parameter p)
           
protected  int convert2int(java.lang.Object obj, Parameter p)
           
protected  long convert2long(java.lang.Object obj, Parameter p)
           
 OmniDTO execute(UserDatabaseConnection udc, java.util.Map<java.lang.String,java.lang.Object> inputs)
          execute
abstract  OmniDTO execute(UserDatabaseConnection udc, java.util.Map<java.lang.String,java.lang.Object> inputs, java.util.Map<java.lang.String,java.lang.String> outputFilters)
          execute with output filter
protected  java.util.Set<java.lang.String> getAllowedColumns(java.util.Map<java.lang.String,java.lang.String> outputFilter, Cursor cursor)
           
 java.sql.DatabaseMetaData getDatabaseMetaData()
          Returns DatabaseMetaData.
protected  RowInfo getFilteredHeaderInfo(java.util.Set<java.lang.String> allowedColumns, Cursor cursor)
           
protected  java.io.InputStream getInputStream(java.lang.Object data)
           
protected  void setBigData(java.sql.PreparedStatement pstmt, java.lang.Object obj, Parameter p)
          Stores object as either blob or clob type in database.
protected  void setBinaryObject(java.sql.PreparedStatement pstmt, java.lang.Object obj, Parameter p)
          Stores object as binary type in database.
protected  void setBooleanObject(java.sql.PreparedStatement pstmt, int parameterIndex, java.lang.Object parameterObj, int targetSqlType)
           
 void setDatabaseMetaData(java.sql.DatabaseMetaData dbmd)
          Sets DatabaseMetaData.
protected  void setDateTimeObject(java.sql.PreparedStatement pstmt, int parameterIndex, java.lang.Object parameterObj, int targetSqlType)
           
protected  void setNull(java.sql.PreparedStatement pstmt, int parameterIndex, int targetSqlType)
           
protected  void setNumericObject(java.sql.PreparedStatement pstmt, java.lang.Object obj, Parameter p)
           
protected  void setObject(java.sql.PreparedStatement pstmt, java.lang.Object obj, Parameter p)
           
protected  boolean supportsGetGeneratedKeys()
          Checks to see if the connection supports generated keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbmd

protected java.sql.DatabaseMetaData dbmd
Constructor Detail

DataProcessorImpl

public DataProcessorImpl()
Method Detail

execute

public OmniDTO execute(UserDatabaseConnection udc,
                       java.util.Map<java.lang.String,java.lang.Object> inputs)
                throws BaseSQLException
execute

Specified by:
execute in interface DataProcessor
Throws:
BaseSQLException

execute

public abstract OmniDTO execute(UserDatabaseConnection udc,
                                java.util.Map<java.lang.String,java.lang.Object> inputs,
                                java.util.Map<java.lang.String,java.lang.String> outputFilters)
                         throws BaseSQLException
execute with output filter

Specified by:
execute in interface DataProcessor
Throws:
BaseSQLException

getDatabaseMetaData

public java.sql.DatabaseMetaData getDatabaseMetaData()
Returns DatabaseMetaData.

Returns:
an instance of DatabaseMetaData.

setDatabaseMetaData

public void setDatabaseMetaData(java.sql.DatabaseMetaData dbmd)
Sets DatabaseMetaData.

Parameters:
dbmd -

supportsGetGeneratedKeys

protected boolean supportsGetGeneratedKeys()
Checks to see if the connection supports generated keys.

Returns:
true if supports.

getAllowedColumns

protected java.util.Set<java.lang.String> getAllowedColumns(java.util.Map<java.lang.String,java.lang.String> outputFilter,
                                                            Cursor cursor)

getFilteredHeaderInfo

protected RowInfo getFilteredHeaderInfo(java.util.Set<java.lang.String> allowedColumns,
                                        Cursor cursor)

setNull

protected void setNull(java.sql.PreparedStatement pstmt,
                       int parameterIndex,
                       int targetSqlType)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

protected void setObject(java.sql.PreparedStatement pstmt,
                         java.lang.Object obj,
                         Parameter p)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setBooleanObject

protected void setBooleanObject(java.sql.PreparedStatement pstmt,
                                int parameterIndex,
                                java.lang.Object parameterObj,
                                int targetSqlType)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

setNumericObject

protected void setNumericObject(java.sql.PreparedStatement pstmt,
                                java.lang.Object obj,
                                Parameter p)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

setBinaryObject

protected void setBinaryObject(java.sql.PreparedStatement pstmt,
                               java.lang.Object obj,
                               Parameter p)
                        throws java.sql.SQLException
Stores object as binary type in database. Acceptable types of obj are java.io.InputStream, byte[], java.io.File, java.lang.String and any object whose content can be obtained from its toString() method.

Parameters:
pstmt - PreparedStatement statement
obj - The data to be persisted
p - Parameter instance
Throws:
java.sql.SQLException

setBigData

protected void setBigData(java.sql.PreparedStatement pstmt,
                          java.lang.Object obj,
                          Parameter p)
                   throws java.sql.SQLException
Stores object as either blob or clob type in database. Acceptable types of obj are java.io.InputStream, byte[], java.io.File, java.lang.String and any object whose content can be obtained from its toString() method.

Parameters:
pstmt - PreparedStatement statement
obj - The data to be persisted
p - Parameter instance
Throws:
java.sql.SQLException

getInputStream

protected java.io.InputStream getInputStream(java.lang.Object data)
                                      throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

convert2int

protected int convert2int(java.lang.Object obj,
                          Parameter p)

convert2long

protected long convert2long(java.lang.Object obj,
                            Parameter p)

convert2float

protected float convert2float(java.lang.Object obj,
                              Parameter p)

convert2double

protected double convert2double(java.lang.Object obj,
                                Parameter p)

convert2BigDecimal

protected java.math.BigDecimal convert2BigDecimal(java.lang.Object obj,
                                                  Parameter p)

setDateTimeObject

protected void setDateTimeObject(java.sql.PreparedStatement pstmt,
                                 int parameterIndex,
                                 java.lang.Object parameterObj,
                                 int targetSqlType)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException