info.fingo.db
Class DatabaseOperationsOracle

java.lang.Object
  extended by info.fingo.db.DatabaseOperations
      extended by info.fingo.db.DatabaseOperationsOracle

public class DatabaseOperationsOracle
extends DatabaseOperations

Class for Oracle specific database operations.

Author:
FINGO - Jan Wielgus

Field Summary
 
Fields inherited from class info.fingo.db.DatabaseOperations
MSSQL_SUFFIX, ORACLE_SUFFIX
 
Constructor Summary
DatabaseOperationsOracle()
           
 
Method Summary
protected  void bindInputParameter(java.sql.PreparedStatement ps, int type, int index, java.lang.Object value)
          Binds a single parameter to its value in the given PreparedStatement
protected  void bindParameters(BaseCollection peer, BaseEntity entity, java.util.ArrayList<java.lang.String> names, java.sql.PreparedStatement ps, int initialIndex)
          Binds parameters for the given PreparedStatement objects
 void bindResourceCallParams(java.sql.CallableStatement cs, java.util.ArrayList<Parameter> params, java.sql.Connection conn)
          Binds parameters for a callable statement for a SQL statement taken from an external resource
 void bindResourceParams(java.sql.PreparedStatement ps, java.util.ArrayList<Parameter> params, java.sql.Connection conn)
          Binds parameters for a prepared statement for a SQL statement taken from an external resource
 void mapAndSetCallOutParam(java.sql.CallableStatement cs, Parameter p)
          Maps an OUT parameter for the given CallableStatement
 BaseEntity mapResultSet(java.sql.ResultSet rs, BaseCollection collection)
          Maps the given result set to a BaseEntity object
protected  int mapToSpecificTypeNumber(Column.GenericTypes genericType)
          Maps the given generic data type to its JDBC numeric value
 java.lang.Object save(BaseCollection peer, BaseEntity bo, java.sql.Connection conn)
          Saves or updates the given BaseEntity object in the database
 
Methods inherited from class info.fingo.db.DatabaseOperations
delete, deleteByPrimaryKey, execute, getColumn, getColumnForName, mapQuery, mapQuery, mapQuery, select, select, select, select, selectAll, selectAll, selectByPrimaryKey, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseOperationsOracle

public DatabaseOperationsOracle()
Method Detail

mapResultSet

public BaseEntity mapResultSet(java.sql.ResultSet rs,
                               BaseCollection collection)
                        throws java.sql.SQLException
Description copied from class: DatabaseOperations
Maps the given result set to a BaseEntity object

Specified by:
mapResultSet in class DatabaseOperations
Parameters:
rs - The used ResultSet object
collection - The used BaseCollection object
Returns:
The mapped BaseEntity object
Throws:
java.sql.SQLException

save

public java.lang.Object save(BaseCollection peer,
                             BaseEntity bo,
                             java.sql.Connection conn)
                      throws java.sql.SQLException,
                             java.io.IOException
Description copied from class: DatabaseOperations
Saves or updates the given BaseEntity object in the database

Specified by:
save in class DatabaseOperations
Parameters:
peer - The collection the BaseEntity object belongs to
bo - The BaseEntity object to be saved
conn - The used Connection object
Returns:
The saved/updated instance
Throws:
java.sql.SQLException
java.io.IOException

bindInputParameter

protected void bindInputParameter(java.sql.PreparedStatement ps,
                                  int type,
                                  int index,
                                  java.lang.Object value)
                           throws java.sql.SQLException
Description copied from class: DatabaseOperations
Binds a single parameter to its value in the given PreparedStatement

Specified by:
bindInputParameter in class DatabaseOperations
Parameters:
ps - The PreparedStatement object used
type - Numeric representation of the parameter data type
index - Index of the parameter in the prepared statement
value - Value of the parameter
Throws:
java.sql.SQLException

bindParameters

protected void bindParameters(BaseCollection peer,
                              BaseEntity entity,
                              java.util.ArrayList<java.lang.String> names,
                              java.sql.PreparedStatement ps,
                              int initialIndex)
                       throws java.sql.SQLException
Description copied from class: DatabaseOperations
Binds parameters for the given PreparedStatement objects

Specified by:
bindParameters in class DatabaseOperations
Parameters:
peer - The used BaseCollection object
entity - The used BaseEntity object from which parameter values are taken
names - An ArrayList of parameters' names
ps - The used PreparedStatement object
initialIndex - The index with the parameters' binding shall start
Throws:
java.sql.SQLException

bindResourceParams

public void bindResourceParams(java.sql.PreparedStatement ps,
                               java.util.ArrayList<Parameter> params,
                               java.sql.Connection conn)
                        throws java.sql.SQLException,
                               java.io.IOException
Description copied from class: DatabaseOperations
Binds parameters for a prepared statement for a SQL statement taken from an external resource

Specified by:
bindResourceParams in class DatabaseOperations
Parameters:
ps - The used PreparedStatement object
params - An ArrayList of the parameters to be bound
conn - The used Connection object
Throws:
java.sql.SQLException
java.io.IOException

mapToSpecificTypeNumber

protected int mapToSpecificTypeNumber(Column.GenericTypes genericType)
Description copied from class: DatabaseOperations
Maps the given generic data type to its JDBC numeric value

Specified by:
mapToSpecificTypeNumber in class DatabaseOperations
Returns:
The JDBC numeric value of the data type

bindResourceCallParams

public void bindResourceCallParams(java.sql.CallableStatement cs,
                                   java.util.ArrayList<Parameter> params,
                                   java.sql.Connection conn)
                            throws java.sql.SQLException,
                                   java.io.IOException
Description copied from class: DatabaseOperations
Binds parameters for a callable statement for a SQL statement taken from an external resource

Specified by:
bindResourceCallParams in class DatabaseOperations
Parameters:
cs - The used CallableStatement object
params - An ArrayList of the parameters to be bound
conn - The used Connection object
Throws:
java.sql.SQLException
java.io.IOException

mapAndSetCallOutParam

public void mapAndSetCallOutParam(java.sql.CallableStatement cs,
                                  Parameter p)
                           throws java.sql.SQLException
Description copied from class: DatabaseOperations
Maps an OUT parameter for the given CallableStatement

Specified by:
mapAndSetCallOutParam in class DatabaseOperations
Parameters:
cs - The used CallableStatement object
p - The parameter to be set
Throws:
java.sql.SQLException