|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lokahi.core.common.interfaces.GenericDatabaseBroker<T>
public abstract class GenericDatabaseBroker<T extends Dao>
Base class for interaction with sql databases.
Currently implements methods to build callable statements and build singular objects from the result set.
Constructor Summary | |
---|---|
GenericDatabaseBroker()
|
Method Summary | |
---|---|
protected java.sql.CallableStatement |
buildParams(java.sql.CallableStatement csmt,
boolean returns,
int returnType,
java.lang.Object... params)
Builds the parameter list for a CallableStatement object
based upon the parameters passed, currently supports only objects of
Integer , String , and byte[]
(for blobs) types. |
protected T |
fillObject(java.lang.Class<T> c,
java.sql.ResultSet r)
Finds and calls the appropriate fillObject for the given class |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericDatabaseBroker()
Method Detail |
---|
protected java.sql.CallableStatement buildParams(java.sql.CallableStatement csmt, boolean returns, int returnType, java.lang.Object... params) throws java.sql.SQLException
CallableStatement
object
based upon the parameters passed, currently supports only objects of
Integer
, String
, and byte[]
(for blobs) types.
Prevents the need to explictitly code all CallableStatement
s
csmt
- returns
- true
if the statement being built returns any valuereturnType
- as specified by the jdbc driverparams
- passed to the stored procedure or function
CallableStatement
populated with the objects in params
java.sql.SQLException
protected T fillObject(java.lang.Class<T> c, java.sql.ResultSet r)
fillObject
for the given class
c
- Class
that must implements the
Dao
interface that the
returned object is expected to be.r
- ResultSet
to build the object out of
Class T
or null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |