|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.jpattern.orm.query.AQuery
com.googlecode.jpattern.orm.query.ABaseOrmQuery
com.googlecode.jpattern.orm.query.OrmQuery<T>
public class OrmQuery<T>
| Constructor Summary | |
|---|---|
OrmQuery(IOrmClassToolMap ormClassToolMap,
ISessionSqlPerformer session,
Class<T> clazz,
Class<?>... joinClasses)
|
|
| 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. |
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 |
protected void |
renderFrom(StringBuilder StringBuilder)
|
protected void |
renderOrderBy(StringBuilder StringBuilder)
|
protected void |
renderSelect(StringBuilder StringBuilder)
|
protected void |
renderWhere(StringBuilder StringBuilder)
|
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. |
void |
setNameSolver(INameSolver nameSolver)
|
IOrmQuery<T> |
setQueryTimeout(int queryTimeout)
Set the query timeout for the query. |
| Methods inherited from class com.googlecode.jpattern.orm.query.ABaseOrmQuery |
|---|
appendValues, join, orderBy, renderSql, renderSql, setJoin, setOrderBy, setWhere, where |
| 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.query.IBaseOrmQuery |
|---|
join, orderBy, where |
| Methods inherited from interface com.googlecode.jpattern.orm.query.IQuery |
|---|
appendValues |
| Methods inherited from interface com.googlecode.jpattern.orm.query.IRenderableSqlObject |
|---|
renderSql, renderSql |
| Constructor Detail |
|---|
public OrmQuery(IOrmClassToolMap ormClassToolMap,
ISessionSqlPerformer session,
Class<T> clazz,
Class<?>... joinClasses)
| Method Detail |
|---|
public final int getMaxRows()
throws OrmException
IQuery
getMaxRows in interface IQueryOrmExceptionpublic final IOrmQuery<T> setQueryTimeout(int queryTimeout)
IOrmQuery
setQueryTimeout in interface IOrmQuery<T>setQueryTimeout in interface IQuerypublic final int getQueryTimeout()
IQuery
getQueryTimeout in interface IQuery
public final IOrmQuery<T> setMaxRows(int maxRows)
throws OrmException
IOrmQuery
setMaxRows in interface IOrmQuery<T>setMaxRows in interface IQueryOrmExceptionpublic void setNameSolver(INameSolver nameSolver)
setNameSolver in interface INameSolverConsumerpublic List<T> findList()
IOrmQuery
findList in interface IOrmQuery<T>
public void find(IOrmSerialResultReader<T> srr)
throws OrmException
IOrmQuery
find in interface IOrmQuery<T>OrmExceptionpublic long findRowCount()
IOrmQuery
findRowCount in interface IOrmQuery<T>
public T findUnique()
throws OrmNotUniqueResultException
IOrmQuery
findUnique in interface IOrmQuery<T>OrmNotUniqueResultException - if more than one row is returned from the querypublic String getGeneratedRowCountSql()
IOrmQuery
getGeneratedRowCountSql in interface IOrmQuery<T>public IOrmQuery<T> setDistinct()
IOrmQuery
setDistinct in interface IOrmQuery<T>protected void renderSelect(StringBuilder StringBuilder)
renderSelect in class ABaseOrmQueryprotected void renderFrom(StringBuilder StringBuilder)
renderFrom in class ABaseOrmQueryprotected void renderWhere(StringBuilder StringBuilder)
renderWhere in class ABaseOrmQueryprotected void renderOrderBy(StringBuilder StringBuilder)
renderOrderBy in class ABaseOrmQuery
public boolean isDistinct()
throws OrmException
IOrmQuery
isDistinct in interface IOrmQuery<T>OrmException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||