net.sqlind
Class SQLQueryMapper.SQLQueryHandler

java.lang.Object
  extended by net.sqlind.SQLQueryMapper.GenericQueryHandler
      extended by net.sqlind.SQLQueryMapper.SQLQueryHandler
Enclosing class:
SQLQueryMapper

public class SQLQueryMapper.SQLQueryHandler
extends SQLQueryMapper.GenericQueryHandler


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sqlind.SQLQueryMapper.GenericQueryHandler
SQLQueryMapper.GenericQueryHandler.BeanListWiringBehavior<T>, SQLQueryMapper.GenericQueryHandler.BeanWiringBehavior<T>, SQLQueryMapper.GenericQueryHandler.ResultSetFecthedBehaviour, SQLQueryMapper.GenericQueryHandler.SingleBeanListWiringBehavior<T>
 
Field Summary
 
Fields inherited from class net.sqlind.SQLQueryMapper.GenericQueryHandler
injectPointValues, parameterValues, ps, rs, template
 
Constructor Summary
protected SQLQueryMapper.SQLQueryHandler(SQLQueryMapper.SQLQueryTemplate template)
           
 
Method Summary
protected  void fillInPreparedStatement(PreparedStatement ps, HashMap<String,Object> pValues)
           
<T> List<T>
getBeanList(Connection cnx, Class beanTypeClazz)
          Perform a query using the 'one bean per rupture' wiring behavior
<T> T
getSimpleResult(Connection cnx)
          Perform a query and return a single result from the first record
<T> List<T>
getSimpleResultList(Connection cnx, Class simpleTypeClazz)
          Perform a query and return a simple type result list
<T> List<T>
getSingleBeanList(Connection cnx, Class beanTypeClazz)
          Perform a query using the 'one bean per record' wiring behavior
 void performSelectQuery(Connection cnx, SQLQueryMapper.QueryBehavior behaviour)
          Perform a select over DB using current query definition.
 void performUpdateQuery(Connection cnx)
          Perform an update over DB using current query definition.
 
Methods inherited from class net.sqlind.SQLQueryMapper.GenericQueryHandler
close, dumpQuery, fillInParametersFromBean, getInjectedSQL, getInjectPoints, getSQL, getSQLWithParameters, performInjection, setInjection, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLQueryMapper.SQLQueryHandler

protected SQLQueryMapper.SQLQueryHandler(SQLQueryMapper.SQLQueryTemplate template)
Method Detail

getBeanList

public <T> List<T> getBeanList(Connection cnx,
                               Class beanTypeClazz)
                    throws SQLQueryMapper.SQLMapperException
Perform a query using the 'one bean per rupture' wiring behavior

Parameters:
cnx - the DB connection instance
Returns:
a T bean list
Throws:
SQLQueryMapper.SQLMapperException

getSingleBeanList

public <T> List<T> getSingleBeanList(Connection cnx,
                                     Class beanTypeClazz)
                          throws SQLQueryMapper.SQLMapperException
Perform a query using the 'one bean per record' wiring behavior

Parameters:
cnx - the DB connection instance
Returns:
a T bean list
Throws:
SQLQueryMapper.SQLMapperException

getSimpleResultList

public <T> List<T> getSimpleResultList(Connection cnx,
                                       Class simpleTypeClazz)
                            throws SQLQueryMapper.SQLMapperException
Perform a query and return a simple type result list

Parameters:
cnx - the DB connection instance
Returns:
a List of T type instances.
Throws:
SQLQueryMapper.SQLMapperException

getSimpleResult

public <T> T getSimpleResult(Connection cnx)
                  throws SQLQueryMapper.SQLMapperException
Perform a query and return a single result from the first record

Parameters:
cnx - the DB connection instance
Returns:
an instance of T if found, null otherwise
Throws:
SQLQueryMapper.SQLMapperException

performUpdateQuery

public void performUpdateQuery(Connection cnx)
                        throws SQLQueryMapper.SQLMapperException
Perform an update over DB using current query definition.

Parameters:
cnx - the DB connection instance
Throws:
SQLQueryMapper.SQLMapperException

performSelectQuery

public void performSelectQuery(Connection cnx,
                               SQLQueryMapper.QueryBehavior behaviour)
                        throws SQLQueryMapper.SQLMapperException
Perform a select over DB using current query definition.

Parameters:
cnx - the DB connection instance
Throws:
SQLQueryMapper.SQLMapperException

fillInPreparedStatement

protected void fillInPreparedStatement(PreparedStatement ps,
                                       HashMap<String,Object> pValues)
                                throws SQLException
Throws:
SQLException


Copyright © 2011. All Rights Reserved.