com.googlecode.jpattern.orm.query
Interface IOrmQuery<T>

All Superinterfaces:
IBaseOrmQuery, IQuery, IRenderableSqlObject
All Known Implementing Classes:
OrmQuery

public interface IOrmQuery<T>
extends IBaseOrmQuery

Author:
Francesco Cina 18/giu/2011

Method Summary
 void find(IOrmSerialResultReader<T> srr)
          Execute the query and for every object created call the IOrmSerialResultReader.
 List<T> findList()
          Execute the query returning the list of objects.
 long findRowCount()
          Return the count of entities this query should return.
 T findUnique()
          Execute the query returning either a single bean or null (if no matching bean is found).
 String getGeneratedRowCountSql()
          Return the sql that was generated for to return the row count of the execution of this query.
 boolean isDistinct()
          return if use Distinct in the select clause
 IOrmQuery<T> setDistinct()
          use Distinct in the select clause
 IOrmQuery<T> setMaxRows(int maxRows)
          Set the maximum number of rows to return in the query.
 IOrmQuery<T> setQueryTimeout(int queryTimeout)
          Set the query timeout for the query.
 
Methods inherited from interface com.googlecode.jpattern.orm.query.IBaseOrmQuery
join, orderBy, where
 
Methods inherited from interface com.googlecode.jpattern.orm.query.IQuery
appendValues, getMaxRows, getQueryTimeout
 
Methods inherited from interface com.googlecode.jpattern.orm.query.IRenderableSqlObject
renderSql, renderSql
 

Method Detail

findList

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

Returns:
Throws:
OrmException

findRowCount

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

Returns:
Throws:
OrmException

findUnique

T findUnique()
             throws OrmException,
                    OrmNotUniqueResultException
Execute the query returning either a single bean or null (if no matching bean is found).

Returns:
Throws:
OrmNotUniqueResultException - if more than one row is returned from the query
OrmException

find

void find(IOrmSerialResultReader<T> 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 for to return the row count of the execution of this query.

Returns:
Throws:
OrmException

setDistinct

IOrmQuery<T> setDistinct()
                         throws OrmException
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

setMaxRows

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

Specified by:
setMaxRows in interface IQuery
Parameters:
maxRows -
Returns:
Throws:
OrmException

setQueryTimeout

IOrmQuery<T> setQueryTimeout(int queryTimeout)
Set the query timeout for the query.

Specified by:
setQueryTimeout in interface IQuery


Copyright © 2011. All Rights Reserved.