org.opensubsystems.core.persist.db
Class DatabaseReadSingleDataObjectOperation
java.lang.Object
org.opensubsystems.core.persist.db.DatabaseOperation
org.opensubsystems.core.persist.db.DatabaseReadOperation
org.opensubsystems.core.persist.db.DatabaseReadSingleDataObjectOperation
- All Implemented Interfaces:
- DatabaseOperations
public class DatabaseReadSingleDataObjectOperation
- extends DatabaseReadOperation
Adapter to simplify writing of database reads which read single data object,
which takes care of requesting and returning connections, transaction
management, query preparation and exception handling.
- Version:
- $Id: DatabaseReadSingleDataObjectOperation.java,v 1.7 2007/01/28 06:54:42 bastafidli Exp $
- Author:
- Julian Legeny
- Code reviewer:
- TODO: Review this code
- Code reviewed:
|
Method Summary |
protected java.lang.Object |
performOperation(DatabaseFactoryImpl dbfactory,
java.sql.Connection cntConnection,
java.sql.PreparedStatement pstmQuery)
Define content of this method to perform the database operation using the
provided connection and optional prepared statement. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabaseReadSingleDataObjectOperation
public DatabaseReadSingleDataObjectOperation(DatabaseFactoryImpl factory,
java.lang.String strQuery,
DatabaseSchema schema,
int iId,
int iDomainId)
- Constructor to use when database update doesn't require any prepared
statement.
- Parameters:
factory - - factory which is executing this operationstrQuery - - sql query that has to be processedschema - - database schema used with this operationiId - - ID of data object to readiDomainId - - ID of domain the data object belongs to
performOperation
protected java.lang.Object performOperation(DatabaseFactoryImpl dbfactory,
java.sql.Connection cntConnection,
java.sql.PreparedStatement pstmQuery)
throws OSSException,
java.sql.SQLException
- Define content of this method to perform the database operation using the
provided connection and optional prepared statement.
- Overrides:
performOperation in class DatabaseReadOperation
- Parameters:
dbfactory - - database factory executing this operationcntConnection - - ready to use connection to perform the database
operation. No need to return this connection.pstmQuery - - prepared statement for query passed in as a
parameter to the constructor. No need to close
this statement. If no query was passed into
constructor, this will be null.
- Returns:
- Object - data read from the database accessible through getReturnData
- Throws:
OSSException - - an error has occured
java.sql.SQLException - - an error has occured
Copyright © 2003 - 2006 OpenSubsystems s.r.o.