com.jpattern.orm.query
Interface CustomQuery

All Known Subinterfaces:
CustomFindOrderBy, CustomFindQuery, CustomFindQueryCommon, CustomFindWhere, SqlFindQuery
All Known Implementing Classes:
CustomFindOrderByImpl, CustomFindQueryOrm, CustomFindWhereImpl, PlainSqlFindQuery

public interface CustomQuery

Author:
Francesco Cina 09/lug/2011

Method Summary
<T> T
find(ResultSetReader<T> rsr)
          Execute the query reading the ResultSet with a ResultSetReader.
<T> List<T>
find(ResultSetRowReader<T> rsrr)
          Execute the query reading the ResultSet with a ResultSetRowReader.
 BigDecimal findBigDecimal()
          Execute the query and read the result as a BigDecimal value
 boolean findBoolean()
          Execute the query and read the result as a boolean value
 double findDouble()
          Execute the query and read the result as a double value
 float findFloat()
          Execute the query and read the result as a float value
 int findInt()
          Execute the query and read the result as an int value
 List<Object[]> findList()
          Execute the query and read the result creating a List of all the ordered arrays with the extracted column values for every row.
 long findLong()
          Execute the query and read the result as an long value
 String findString()
          Execute the query and read the result as a String value
 Object[] findUnique()
          Execute the query and read the result creating an ordered array with the extracted column values or null (if no matching bean is found).
<T> T
findUnique(ResultSetRowReader<T> rsrr)
          Execute the query reading the ResultSet with a ResultSetRowReader.
 

Method Detail

find

<T> T find(ResultSetReader<T> rsr)
       throws OrmException
Execute the query reading the ResultSet with a ResultSetReader.

Parameters:
rse - object that will extract all rows of results
Returns:
an arbitrary result object, as returned by the ResultSetReader
Throws:
OrmException

find

<T> List<T> find(ResultSetRowReader<T> rsrr)
             throws OrmException
Execute the query reading the ResultSet with a ResultSetRowReader.

Parameters:
rsrr - object that will extract all rows of results
Returns:
a List of result objects returned by the ResultSetRowReader
Throws:
OrmException

findUnique

<T> T findUnique(ResultSetRowReader<T> rsrr)
             throws OrmException,
                    OrmNotUniqueResultException
Execute the query reading the ResultSet with a ResultSetRowReader.

Parameters:
rsrr - object that will extract the row of result
Returns:
Throws:
OrmException
OrmNotUniqueResultException - if the results of the query executions are not exactly 1

findList

List<Object[]> findList()
                        throws OrmException
Execute the query and read the result creating a List of all the ordered arrays with the extracted column values for every row.

Returns:
Throws:
OrmException

findUnique

Object[] findUnique()
                    throws OrmNotUniqueResultException
Execute the query and read the result creating an ordered array with the extracted column values or null (if no matching bean is found).

Returns:
Throws:
OrmNotUniqueResultException - if not exactly one row is returned from the query

findInt

int findInt()
            throws OrmException
Execute the query and read the result as an int value

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

findLong

long findLong()
              throws OrmException
Execute the query and read the result as an long value

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

findDouble

double findDouble()
                  throws OrmException
Execute the query and read the result as a double value

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

findFloat

float findFloat()
                throws OrmException
Execute the query and read the result as a float value

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

findString

String findString()
                  throws OrmException
Execute the query and read the result as a String value

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

findBoolean

boolean findBoolean()
                    throws OrmException
Execute the query and read the result as a boolean value

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

findBigDecimal

BigDecimal findBigDecimal()
                          throws OrmException
Execute the query and read the result as a BigDecimal value

Parameters:
sql - SQL query to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException


Copyright © 2013. All Rights Reserved.