com.googlecode.jpattern.orm.session
Class ASqlPerformer

java.lang.Object
  extended by com.googlecode.jpattern.orm.session.ASqlPerformer
All Implemented Interfaces:
ISqlPerformer
Direct Known Subclasses:
DataSourceSqlPerformer, JdbcTemplateSqlPerformer

public abstract class ASqlPerformer
extends Object
implements ISqlPerformer

Author:
Francesco Cina 02/lug/2011

Constructor Summary
ASqlPerformer()
           
 
Method Summary
 Object[] queryForArray(String sql, Object... values)
          Execute a query given static SQL and read the result creating an ordered array with the extracted column values (return null if no rows are returned)
 BigDecimal queryForBigDecimal(String sql, Object... values)
          Execute a query given static SQL and read the result as a BigDecimal value (return null if no rows are returned)
 Boolean queryForBoolean(String sql, Object... values)
          Execute a query given static SQL and read the result as a boolean value (return null if no rows are returned)
 Double queryForDouble(String sql, Object... values)
          Execute a query given static SQL and read the result as a double value (return null if no rows are returned)
 Float queryForFloat(String sql, Object... values)
          Execute a query given static SQL and read the result as a float value (return null if no rows are returned)
 Integer queryForInt(String sql, Object... values)
          Execute a query given static SQL and read the result as an int value (return null if no rows are returned)
 List<Object[]> queryForList(String sql, Object... values)
          Execute a query given static SQL and read the result creating a List of all the ordered arrays with the extracted column values for every row.
 Long queryForLong(String sql, Object... values)
          Execute a query given static SQL and read the result as an long value (return null if no rows are returned)
 String queryForString(String sql, Object... values)
          Execute a query given static SQL and read the result as a String value (return null if no rows are returned)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.googlecode.jpattern.orm.session.ISqlPerformer
batchUpdate, batchUpdate, batchUpdate, execute, getMaxRows, getQueryTimeout, query, setMaxRows, setQueryTimeout, update, update
 

Constructor Detail

ASqlPerformer

public ASqlPerformer()
Method Detail

queryForInt

public final Integer queryForInt(String sql,
                                 Object... values)
                          throws OrmException,
                                 OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as an int value (return null if no rows are returned)

Specified by:
queryForInt in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForLong

public final Long queryForLong(String sql,
                               Object... values)
                        throws OrmException,
                               OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as an long value (return null if no rows are returned)

Specified by:
queryForLong in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForDouble

public final Double queryForDouble(String sql,
                                   Object... values)
                            throws OrmException,
                                   OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a double value (return null if no rows are returned)

Specified by:
queryForDouble in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForFloat

public final Float queryForFloat(String sql,
                                 Object... values)
                          throws OrmException,
                                 OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a float value (return null if no rows are returned)

Specified by:
queryForFloat in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForString

public final String queryForString(String sql,
                                   Object... values)
                            throws OrmException,
                                   OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a String value (return null if no rows are returned)

Specified by:
queryForString in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForBoolean

public final Boolean queryForBoolean(String sql,
                                     Object... values)
                              throws OrmException,
                                     OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a boolean value (return null if no rows are returned)

Specified by:
queryForBoolean in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForBigDecimal

public final BigDecimal queryForBigDecimal(String sql,
                                           Object... values)
                                    throws OrmException,
                                           OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a BigDecimal value (return null if no rows are returned)

Specified by:
queryForBigDecimal in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForArray

public final Object[] queryForArray(String sql,
                                    Object... values)
                             throws OrmException,
                                    OrmNotUniqueResultException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result creating an ordered array with the extracted column values (return null if no rows are returned)

Specified by:
queryForArray in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

queryForList

public final List<Object[]> queryForList(String sql,
                                         Object... values)
                                  throws OrmException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result creating a List of all the ordered arrays with the extracted column values for every row.

Specified by:
queryForList in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
OrmException


Copyright © 2011. All Rights Reserved.