JDBaccess API 1.0

com.jdbaccess.dao
Class DataAccessObjectImpl

java.lang.Object
  extended by com.jdbaccess.dao.DataAccessObjectImpl
All Implemented Interfaces:
DataAccessObject

public abstract class DataAccessObjectImpl
extends java.lang.Object
implements DataAccessObject

Abstract super class of all data access object implementation classes. If constructor is used with transaction all methods (also finders) use this transaction. If constructor is used empty (without transaction) only finders could be used because selects do not need necessarily a transaction (read transactions).


Constructor Summary
DataAccessObjectImpl()
          Construction of the data access object implementation.
DataAccessObjectImpl(Transaction transaction)
          Construction of the data access object implementation with this transaction.
 
Method Summary
 void createSequence(java.lang.String seqName)
          Creates sequence with that sequence name
 void createTable(java.lang.String sqlCreateTableString)
          Creates table with that create table string
 java.lang.Long delete(TransferObject to)
          Deletes one database row (wit the id of the transfer object) or delete some database rows (with the whereCondition of the transfer object)
 java.lang.Long deleteAll(java.lang.String entity)
          Deletes all rows for that entity
 void dropFunction(java.lang.String functionName)
           
 void dropProcedure(java.lang.String procedureName)
           
 void dropSequence(java.lang.String seqName)
          Drops sequence with that sequence name
 void dropTable(java.lang.String tableName)
          Drops table with that table name
 Function executeFunction(java.lang.String objectType, java.lang.String name, java.lang.String moduleName, java.lang.String functionName, java.util.ArrayList params, java.lang.String outputParamType)
          Try to find the function with that object type and name over the defined data access xml files.
 Procedure executeProcedure(java.lang.String objectType, java.lang.String name, java.lang.String moduleName, java.lang.String procedureName, java.util.ArrayList params, java.util.ArrayList outputParamTypes)
          Try to find the procedure with that object type and name with user defined data access xml files.
 Result find(java.lang.String objectType, java.lang.String selectName)
          Try to do a find with that object type and select name over the defined data access xml files.
 Result find(java.lang.String objectType, java.lang.String selectName, java.lang.String sql, java.lang.String sqlCount, java.util.ArrayList params, java.util.ArrayList orderBy, java.lang.Class resultType, java.util.ArrayList resultFieldTypes, boolean readFull)
          Try to do a find with that object type and select name over the defined data access xml files.
 java.lang.Long getSequenceNextValue(java.lang.String seqName)
          Gets one next value of that sequence
 java.util.ArrayList getSequenceNextValues(java.lang.String seqName, int count)
          Gets "count" number of values for that sequence
 java.util.ArrayList insert(java.util.ArrayList tos)
          Inserts these transfer objects
 TransferObject insert(TransferObject to)
          Inserts this transfer object
 java.lang.Long update(TransferObject to)
          Updates modified values of this transfer object in one database row (over id of that transfer object) or update modified values of this transfer object in some database rows (over whereCondition of that transfer object)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataAccessObjectImpl

public DataAccessObjectImpl()
Construction of the data access object implementation. Initializes also the DAReader.


DataAccessObjectImpl

public DataAccessObjectImpl(Transaction transaction)
Construction of the data access object implementation with this transaction. Initializes also the DAReader.

Parameters:
transaction - transaction
Method Detail

createTable

public void createTable(java.lang.String sqlCreateTableString)
                 throws ApplicationException
Description copied from interface: DataAccessObject
Creates table with that create table string

Specified by:
createTable in interface DataAccessObject
Parameters:
sqlCreateTableString - sql string for creating the table
Throws:
ApplicationException
See Also:
DataAccessObject.createTable(String)

dropTable

public void dropTable(java.lang.String tableName)
               throws ApplicationException
Description copied from interface: DataAccessObject
Drops table with that table name

Specified by:
dropTable in interface DataAccessObject
Parameters:
tableName - table name
Throws:
ApplicationException
See Also:
DataAccessObject.dropTable(String)

createSequence

public void createSequence(java.lang.String seqName)
                    throws ApplicationException
Description copied from interface: DataAccessObject
Creates sequence with that sequence name

Specified by:
createSequence in interface DataAccessObject
Parameters:
seqName - sequence name
Throws:
ApplicationException
See Also:
DataAccessObject.createSequence(String)

dropSequence

public void dropSequence(java.lang.String seqName)
                  throws ApplicationException
Description copied from interface: DataAccessObject
Drops sequence with that sequence name

Specified by:
dropSequence in interface DataAccessObject
Parameters:
seqName - sequence name
Throws:
ApplicationException
See Also:
DataAccessObject.dropSequence(String)

dropProcedure

public void dropProcedure(java.lang.String procedureName)
                   throws ApplicationException
Throws:
ApplicationException
See Also:
DataAccessObject#dropProcedure(String)

dropFunction

public void dropFunction(java.lang.String functionName)
                  throws ApplicationException
Throws:
ApplicationException
See Also:
DataAccessObject#dropFunction(String)

getSequenceNextValue

public java.lang.Long getSequenceNextValue(java.lang.String seqName)
                                    throws ApplicationException
Description copied from interface: DataAccessObject
Gets one next value of that sequence

Specified by:
getSequenceNextValue in interface DataAccessObject
Parameters:
seqName - sequence name
Returns:
next sequence as Long value
Throws:
ApplicationException
See Also:
DataAccessObject.getSequenceNextValue(String)

getSequenceNextValues

public java.util.ArrayList getSequenceNextValues(java.lang.String seqName,
                                                 int count)
                                          throws ApplicationException
Description copied from interface: DataAccessObject
Gets "count" number of values for that sequence

Specified by:
getSequenceNextValues in interface DataAccessObject
Parameters:
seqName - sequence name
count - number of sequences to fetch from sequence
Returns:
sequences as an ArrayList of Long values
Throws:
ApplicationException
See Also:
DataAccessObject.getSequenceNextValues(String, int)

insert

public TransferObject insert(TransferObject to)
                      throws ApplicationException
Description copied from interface: DataAccessObject
Inserts this transfer object

Specified by:
insert in interface DataAccessObject
Parameters:
to - transfer object
Returns:
new inserted transfer object (with new sequence id if transfer object is id object)
Throws:
ApplicationException
See Also:
DataAccessObject.insert(TransferObject)

insert

public java.util.ArrayList insert(java.util.ArrayList tos)
                           throws ApplicationException
Description copied from interface: DataAccessObject
Inserts these transfer objects

Specified by:
insert in interface DataAccessObject
Parameters:
tos - transfer objects
Returns:
ArrayList of new inserted transfer objects (with new sequence id if transfer object is id object)
Throws:
ApplicationException
See Also:
DataAccessObject.insert(ArrayList)

update

public java.lang.Long update(TransferObject to)
                      throws ApplicationException
Description copied from interface: DataAccessObject
Updates modified values of this transfer object in one database row (over id of that transfer object) or update modified values of this transfer object in some database rows (over whereCondition of that transfer object)

Specified by:
update in interface DataAccessObject
Parameters:
to - transfer object
Returns:
count of database rows which were updated
Throws:
ApplicationException
See Also:
DataAccessObject.update(TransferObject)

delete

public java.lang.Long delete(TransferObject to)
                      throws ApplicationException
Description copied from interface: DataAccessObject
Deletes one database row (wit the id of the transfer object) or delete some database rows (with the whereCondition of the transfer object)

Specified by:
delete in interface DataAccessObject
Parameters:
to - transfer object
Returns:
count of database rows which were deleted
Throws:
ApplicationException
See Also:
DataAccessObject.delete(TransferObject)

deleteAll

public java.lang.Long deleteAll(java.lang.String entity)
                         throws ApplicationException
Description copied from interface: DataAccessObject
Deletes all rows for that entity

Specified by:
deleteAll in interface DataAccessObject
Parameters:
entity - table name
Returns:
count of database rows which were deleted
Throws:
ApplicationException
See Also:
DataAccessObject.deleteAll(String)

find

public Result find(java.lang.String objectType,
                   java.lang.String selectName)
            throws ApplicationException
Description copied from interface: DataAccessObject
Try to do a find with that object type and select name over the defined data access xml files. If the select is not found in any data access file the method throws an ApplicationException

Specified by:
find in interface DataAccessObject
Parameters:
objectType - object type of the select object
selectName - name of the select object
Returns:
Result of the select execution
Throws:
ApplicationException
See Also:
DataAccessObject.find(String, String)

find

public Result find(java.lang.String objectType,
                   java.lang.String selectName,
                   java.lang.String sql,
                   java.lang.String sqlCount,
                   java.util.ArrayList params,
                   java.util.ArrayList orderBy,
                   java.lang.Class resultType,
                   java.util.ArrayList resultFieldTypes,
                   boolean readFull)
            throws ApplicationException
Description copied from interface: DataAccessObject
Try to do a find with that object type and select name over the defined data access xml files. If further parameters such as sql, sqlCount etc. are specified these are used.

Specified by:
find in interface DataAccessObject
Parameters:
objectType - object type of the select object
selectName - name of the select object
sql - sql string of the select
sqlCount - sql count string of the select
params - parameters of the select
orderBy - order by parameters of the select
resultType - result type of the select
resultFieldTypes - result field type of the select
readFull - all fields are read full if true
Returns:
Result of the select execution
Throws:
ApplicationException
See Also:
DataAccessObject.find(String, String, String, String, ArrayList, ArrayList, Class, ArrayList, boolean)

executeProcedure

public Procedure executeProcedure(java.lang.String objectType,
                                  java.lang.String name,
                                  java.lang.String moduleName,
                                  java.lang.String procedureName,
                                  java.util.ArrayList params,
                                  java.util.ArrayList outputParamTypes)
                           throws ApplicationException
Description copied from interface: DataAccessObject
Try to find the procedure with that object type and name with user defined data access xml files. If moduleName and procedureName are specified these are used. Then it executes the procedure and returns it.

Specified by:
executeProcedure in interface DataAccessObject
Parameters:
objectType - object type of the procedure object
name - name of the procedure object
moduleName - package name of the database procedure
procedureName - name of the database procedure
params - parameters of the procedure
outputParamTypes - output parameter types of the procedure
Returns:
procedure object which was executed
Throws:
ApplicationException
See Also:
DataAccessObject.executeProcedure(String, String, String, String, ArrayList, ArrayList)

executeFunction

public Function executeFunction(java.lang.String objectType,
                                java.lang.String name,
                                java.lang.String moduleName,
                                java.lang.String functionName,
                                java.util.ArrayList params,
                                java.lang.String outputParamType)
                         throws ApplicationException
Description copied from interface: DataAccessObject
Try to find the function with that object type and name over the defined data access xml files. If moduleName and functionName are specified these are used. Then it executes the function and returns it.

Specified by:
executeFunction in interface DataAccessObject
Parameters:
objectType - object type of the function object
name - of the function object
moduleName - package name of the database function
functionName - name of the database function
params - parameters of the function
outputParamType - output parameter type of the function
Returns:
function object which was executed
Throws:
ApplicationException
See Also:
DataAccessObject.executeFunction(String, String, String, String, ArrayList, String)

JDBaccess API 1.0

Copyright © 2005-2006 JDBaccess.com, Königsweg 210, D-14129 Berlin, Germany. All Rights Reserved.