com.jpattern.orm.query.find
Class FindWhereImpl<BEAN>

java.lang.Object
  extended by com.jpattern.orm.query.SmartRenderableSqlSubElement
      extended by com.jpattern.orm.query.clause.OrmWhere<FindWhere<BEAN>>
          extended by com.jpattern.orm.query.find.FindWhereImpl<BEAN>
All Implemented Interfaces:
BaseFindQuery, SqlClause<FindWhere<BEAN>>, Where<FindWhere<BEAN>>, FindQueryCommon<BEAN>, FindWhere<BEAN>, NameSolverConsumer, QueryRoot, RenderableSqlQuery, RenderableSqlSubElement

public class FindWhereImpl<BEAN>
extends OrmWhere<FindWhere<BEAN>>
implements FindWhere<BEAN>


Constructor Summary
FindWhereImpl(FindQuery<BEAN> findQuery)
           
 
Method Summary
 void appendValues(List<Object> values)
          Append to the list all the values of the expression's elements
 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
 FindOrderBy<BEAN> orderBy()
          Set the order by clause.
 FindQuery<BEAN> query()
           
 String renderSql()
          Return the sql query generated by this IQuery Object
 void renderSql(StringBuilder stringBuilder)
          Append to the string buffer the sql query generated by this IQuery Object
 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.
 FindWhere<BEAN> where()
           
 
Methods inherited from class com.jpattern.orm.query.clause.OrmWhere
allEq, and, and, appendElementValues, doElementRender, eq, eqProperties, ge, geProperties, getElementStatusVersion, gt, gtProperties, ieq, ieqProperties, ilike, in, in, in, isNotNull, isNull, le, leProperties, like, lt, ltProperties, ne, neProperties, nin, nin, nin, nlike, not, or, or, setNameSolver
 
Methods inherited from class com.jpattern.orm.query.SmartRenderableSqlSubElement
isElementStatusChanged, renderSqlElement, renderSqlElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jpattern.orm.query.clause.Where
allEq, and, and, eq, eqProperties, ge, geProperties, gt, gtProperties, ieq, ieqProperties, ilike, in, in, in, isNotNull, isNull, le, leProperties, like, lt, ltProperties, ne, neProperties, nin, nin, nin, nlike, not, or, or
 

Constructor Detail

FindWhereImpl

public FindWhereImpl(FindQuery<BEAN> findQuery)
Method Detail

renderSql

public String renderSql()
Description copied from interface: RenderableSqlQuery
Return the sql query generated by this IQuery Object

Specified by:
renderSql in interface RenderableSqlQuery
Returns:

renderSql

public void renderSql(StringBuilder stringBuilder)
Description copied from interface: RenderableSqlQuery
Append to the string buffer the sql query generated by this IQuery Object

Specified by:
renderSql in interface RenderableSqlQuery

appendValues

public void appendValues(List<Object> values)
Description copied from interface: RenderableSqlQuery
Append to the list all the values of the expression's elements

Specified by:
appendValues in interface RenderableSqlQuery

query

public FindQuery<BEAN> query()
Specified by:
query in interface FindWhere<BEAN>

where

public FindWhere<BEAN> where()
                      throws OrmException
Specified by:
where in class OrmWhere<FindWhere<BEAN>>
Throws:
OrmException

orderBy

public FindOrderBy<BEAN> orderBy()
                          throws OrmException
Description copied from interface: FindWhere
Set the order by clause.

Specified by:
orderBy in interface FindWhere<BEAN>
Returns:
Throws:
OrmException

findList

public List<BEAN> findList()
                    throws OrmException
Description copied from interface: FindQueryCommon
Execute the query returning the list of objects.

Specified by:
findList in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmException

findRowCount

public int findRowCount()
                 throws OrmException
Description copied from interface: FindQueryCommon
Return the count of entities this query should return.

Specified by:
findRowCount in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmException

findUnique

public BEAN findUnique()
                throws OrmException,
                       OrmNotUniqueResultException
Description copied from interface: FindQueryCommon
Execute the query returning either a single bean or an Exception.

Specified by:
findUnique in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmNotUniqueResultException - if zero or more than one row are returned from the query
OrmException

find

public void find(OrmRowMapper<BEAN> srr)
          throws OrmException
Description copied from interface: FindQueryCommon
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.

Specified by:
find in interface FindQueryCommon<BEAN>
Throws:
OrmException

getGeneratedRowCountSql

public String getGeneratedRowCountSql()
                               throws OrmException
Description copied from interface: FindQueryCommon
Return the sql that was generated to return the row count of the execution of this query.

Specified by:
getGeneratedRowCountSql in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmException

setDistinct

public FindQuery<BEAN> setDistinct(boolean distinct)
                            throws OrmException
Description copied from interface: FindQueryCommon
Whether to use Distinct in the select clause

Specified by:
setDistinct in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmException

isDistinct

public boolean isDistinct()
                   throws OrmException
Description copied from interface: FindQueryCommon
return if use Distinct in the select clause

Specified by:
isDistinct in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmException

setLockMode

public FindQuery<BEAN> setLockMode(LockMode lockMode)
Specified by:
setLockMode in interface FindQueryCommon<BEAN>
Returns:

getLockMode

public LockMode getLockMode()
Description copied from interface: FindQueryCommon
Return the current lock mode

Specified by:
getLockMode in interface FindQueryCommon<BEAN>
Returns:

getMaxRows

public int getMaxRows()
               throws OrmException
Description copied from interface: FindQueryCommon
Return the max rows for this query.

Specified by:
getMaxRows in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmException

setMaxRows

public FindQuery<BEAN> setMaxRows(int maxRows)
                           throws OrmException
Description copied from interface: FindQueryCommon
Set the maximum number of rows to return in the query.

Specified by:
setMaxRows in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmException

setQueryTimeout

public FindQuery<BEAN> setQueryTimeout(int queryTimeout)
Description copied from interface: FindQueryCommon
Set the query timeout for the query.

Specified by:
setQueryTimeout in interface FindQueryCommon<BEAN>

getQueryTimeout

public int getQueryTimeout()
Description copied from interface: FindQueryCommon
Return the query timeout for the query.

Specified by:
getQueryTimeout in interface FindQueryCommon<BEAN>

find

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

Specified by:
find in interface FindQueryCommon<BEAN>
Returns:
Throws:
OrmNotUniqueResultException - if zero or more than one row are returned from the query
OrmException


Copyright © 2013. All Rights Reserved.