com.jpattern.orm.query.find
Interface FindQueryCommon<BEAN>

All Superinterfaces:
BaseFindQuery, QueryRoot, RenderableSqlQuery
All Known Subinterfaces:
FindOrderBy<BEAN>, FindQuery<BEAN>, FindWhere<BEAN>
All Known Implementing Classes:
FindOrderByImpl, FindQueryOrm, FindWhereImpl

public interface FindQueryCommon<BEAN>
extends BaseFindQuery

Author:
Francesco Cina 18/giu/2011

Method Summary
 BEAN find()
          Execute the query returning either a single bean, if the ResultSet contains at least one row, or null, if no matching beans are found).
 void find(OrmRowMapper<BEAN> srr)
          Execute the query and for every object created call the IOrmSerialResultReader.
 List<BEAN> findList()
          Execute the query returning the list of objects.
 int findRowCount()
          Return the count of entities this query should return.
 BEAN findUnique()
          Execute the query returning either a single bean or an Exception.
 String getGeneratedRowCountSql()
          Return the sql that was generated to return the row count of the execution of this query.
 LockMode getLockMode()
          Return the current lock mode
 int getMaxRows()
          Return the max rows for this query.
 int getQueryTimeout()
          Return the query timeout for the query.
 boolean isDistinct()
          return if use Distinct in the select clause
 FindQuery<BEAN> setDistinct(boolean distinct)
          Whether to use Distinct in the select clause
 FindQuery<BEAN> setLockMode(LockMode lockMode)
           
 FindQuery<BEAN> setMaxRows(int maxRows)
          Set the maximum number of rows to return in the query.
 FindQuery<BEAN> setQueryTimeout(int queryTimeout)
          Set the query timeout for the query.
 
Methods inherited from interface com.jpattern.orm.query.RenderableSqlQuery
appendValues, renderSql, renderSql
 

Method Detail

findList

List<BEAN> findList()
                    throws OrmException
Execute the query returning the list of objects.

Returns:
Throws:
OrmException

findRowCount

int findRowCount()
                 throws OrmException
Return the count of entities this query should return.

Returns:
Throws:
OrmException

findUnique

BEAN findUnique()
                throws OrmException,
                       OrmNotUniqueResultException
Execute the query returning either a single bean or an Exception.

Returns:
Throws:
OrmNotUniqueResultException - if zero or more than one row are returned from the query
OrmException

find

BEAN find()
          throws OrmException,
                 OrmNotUniqueResultException
Execute the query returning either a single bean, if the ResultSet contains at least one row, or null, if no matching beans are found).

Returns:
Throws:
OrmNotUniqueResultException - if zero or more than one row are returned from the query
OrmException

find

void find(OrmRowMapper<BEAN> srr)
          throws OrmException
Execute the query and for every object created call the IOrmSerialResultReader. The objects are created one after the other to avoid the use of too much memory.

Parameters:
srr -
Throws:
OrmException

getGeneratedRowCountSql

String getGeneratedRowCountSql()
                               throws OrmException
Return the sql that was generated to return the row count of the execution of this query.

Returns:
Throws:
OrmException

setDistinct

FindQuery<BEAN> setDistinct(boolean distinct)
                            throws OrmException
Whether to use Distinct in the select clause

Returns:
Throws:
OrmException

isDistinct

boolean isDistinct()
                   throws OrmException
return if use Distinct in the select clause

Returns:
Throws:
OrmException

setLockMode

FindQuery<BEAN> setLockMode(LockMode lockMode)
Parameters:
lockMode -
Returns:

getLockMode

LockMode getLockMode()
Return the current lock mode

Returns:

getMaxRows

int getMaxRows()
               throws OrmException
Return the max rows for this query.

Returns:
Throws:
OrmException

setMaxRows

FindQuery<BEAN> setMaxRows(int maxRows)
                           throws OrmException
Set the maximum number of rows to return in the query.

Parameters:
maxRows -
Returns:
Throws:
OrmException

setQueryTimeout

FindQuery<BEAN> setQueryTimeout(int queryTimeout)
Set the query timeout for the query.


getQueryTimeout

int getQueryTimeout()
Return the query timeout for the query.



Copyright © 2013. All Rights Reserved.