Class CannedQueryDAOImpl
java.lang.Object
org.alfresco.repo.domain.query.AbstractCannedQueryDAOImpl
org.alfresco.repo.domain.query.ibatis.CannedQueryDAOImpl
- All Implemented Interfaces:
CannedQueryDAO
DAO implementation providing canned query support.
- Since:
- 3.5
- Author:
- Derek Hulley
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.query.CannedQueryDAO
CannedQueryDAO.ResultHandler<R> -
Field Summary
Fields inherited from class org.alfresco.repo.domain.query.AbstractCannedQueryDAOImpl
controlDAO, logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecuteCountQuery(String sqlNamespace, String queryName, Object parameterObj) Execute a count(*)-style query returning a count value.<R> List<R>executeQuery(String sqlNamespace, String queryName, Object parameterObj, int offset, int limit) Execute a query that returns one or more results.<R> voidexecuteQuery(String sqlNamespace, String queryName, Object parameterObj, int offset, int limit, CannedQueryDAO.ResultHandler<R> handler) Execute a query that returns one or more results, processing the results using a handler.<R> RexecuteQueryUnique(String sqlNamespace, String queryName, Object parameterObj) Execute a query that returns exactly one result.voidinit()Checks that properties have been setfinal voidsetSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate) Methods inherited from class org.alfresco.repo.domain.query.AbstractCannedQueryDAOImpl
setControlDAO
-
Constructor Details
-
CannedQueryDAOImpl
public CannedQueryDAOImpl()
-
-
Method Details
-
setSqlSessionTemplate
public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate) -
init
public void init()Description copied from class:AbstractCannedQueryDAOImplChecks that properties have been set- Overrides:
initin classAbstractCannedQueryDAOImpl
-
executeCountQuery
Execute a count(*)-style query returning a count value. The implementation will ensure that null is substituted with 0, if required.All exceptions can be safely caught and handled as required.
Only one return value is allowed and is checked to prevent null returns.
- Parameters:
sqlNamespace- the query namespace (defined by config file) e.g. alfresco.query.usagequeryName- the name of the query e.g. select_userCountparameterObj- the values to drive the selection (may be null if not required)- Returns:
- a non-null count
-
executeQueryUnique
Description copied from interface:CannedQueryDAOExecute a query that returns exactly one result. The assumption is that the parameters provided uniquely identify the object.- Type Parameters:
R- the return value's type- Parameters:
sqlNamespace- the query namespace (defined by config file) e.g. alfresco.query.usagequeryName- the name of the query e.g. select_userCountparameterObj- the values to drive the selection (may be null if not required)- Returns:
- the unique result (never null)
-
executeQuery
public <R> List<R> executeQuery(String sqlNamespace, String queryName, Object parameterObj, int offset, int limit) Description copied from interface:CannedQueryDAOExecute a query that returns one or more results.- Type Parameters:
R- the return value's type- Parameters:
sqlNamespace- the query namespace (defined by config file) e.g. alfresco.query.usagequeryName- the name of the query e.g. select_userCountparameterObj- the values to drive the selection (may be null if not required)offset- the number of results to skiplimit- the maximum number of results to retrieve orInteger.MAX_VALUEfor no limit- Returns:
- the list of results
-
executeQuery
public <R> void executeQuery(String sqlNamespace, String queryName, Object parameterObj, int offset, int limit, CannedQueryDAO.ResultHandler<R> handler) Description copied from interface:CannedQueryDAOExecute a query that returns one or more results, processing the results using a handler.- Type Parameters:
R- the return value's type- Parameters:
sqlNamespace- the query namespace (defined by config file) e.g. alfresco.query.usagequeryName- the name of the query e.g. select_userCountparameterObj- the values to drive the selection (may be null if not required)offset- the number of results to skiplimit- the maximum number of results to retrieve orInteger.MAX_VALUEfor no limit
-