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
 BigDecimal queryForBigDecimal(String sql, Object... values)
          Execute a query given static SQL and read the result as a BigDecimal value
 boolean queryForBoolean(String sql, Object... values)
          Execute a query given static SQL and read the result as a boolean value
 double queryForDouble(String sql, Object... values)
          Execute a query given static SQL and read the result as a double value
 float queryForFloat(String sql, Object... values)
          Execute a query given static SQL and read the result as a float value
 int queryForInt(String sql, Object... values)
          Execute a query given static SQL and read the result as an int value
 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
 String queryForString(String sql, Object... values)
          Execute a query given static SQL and read the result as a String value
 
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 int queryForInt(String sql,
                             Object... values)
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as an int value

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

queryForLong

public final long queryForLong(String sql,
                               Object... values)
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as an long value

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

queryForDouble

public final double queryForDouble(String sql,
                                   Object... values)
                            throws OrmException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a double value

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

queryForFloat

public final float queryForFloat(String sql,
                                 Object... values)
                          throws OrmException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a float value

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

queryForString

public final String queryForString(String sql,
                                   Object... values)
                            throws OrmException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a String value

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

queryForBoolean

public final boolean queryForBoolean(String sql,
                                     Object... values)
                              throws OrmException
Description copied from interface: ISqlPerformer
Execute a query given static SQL and read the result as a boolean value

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

queryForBigDecimal

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

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

queryForArray

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

Specified by:
queryForArray in interface ISqlPerformer
Parameters:
sql - SQL query to execute
values - arguments to bind to the query
Returns:
Throws:
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.