org.alfresco.repo.domain.query.ibatis
Class CannedQueryDAOImpl

java.lang.Object
  extended by org.alfresco.repo.domain.query.AbstractCannedQueryDAOImpl
      extended by org.alfresco.repo.domain.query.ibatis.CannedQueryDAOImpl
All Implemented Interfaces:
CannedQueryDAO

public class CannedQueryDAOImpl
extends AbstractCannedQueryDAOImpl

DAO implementation providing canned query support.

Since:
3.5

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.query.CannedQueryDAO
CannedQueryDAO.ResultHandler
 
Field Summary
 
Fields inherited from class org.alfresco.repo.domain.query.AbstractCannedQueryDAOImpl
controlDAO, logger
 
Constructor Summary
CannedQueryDAOImpl()
           
 
Method Summary
 java.lang.Long executeCountQuery(java.lang.String sqlNamespace, java.lang.String queryName, java.lang.Object parameterObj)
          Execute a count(*)-style query returning a count value.
 java.util.List executeQuery(java.lang.String sqlNamespace, java.lang.String queryName, java.lang.Object parameterObj, int offset, int limit)
          Execute a query that returns one or more results.
 void executeQuery(java.lang.String sqlNamespace, java.lang.String queryName, java.lang.Object parameterObj, int offset, int limit, CannedQueryDAO.ResultHandler handler)
          Execute a query that returns one or more results, processing the results using a handler.
 java.lang.Object executeQueryUnique(java.lang.String sqlNamespace, java.lang.String queryName, java.lang.Object parameterObj)
          Execute a query that returns exactly one result.
 void init()
          Checks that properties have been set
 void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
           
 
Methods inherited from class org.alfresco.repo.domain.query.AbstractCannedQueryDAOImpl
setControlDAO
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CannedQueryDAOImpl

public CannedQueryDAOImpl()
Method Detail

setSqlSessionTemplate

public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)

init

public void init()
Description copied from class: AbstractCannedQueryDAOImpl
Checks that properties have been set

Overrides:
init in class AbstractCannedQueryDAOImpl

executeCountQuery

public java.lang.Long executeCountQuery(java.lang.String sqlNamespace,
                                        java.lang.String queryName,
                                        java.lang.Object parameterObj)
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.usage
queryName - the name of the query e.g. select_userCount
parameterObj - the values to drive the selection (may be null if not required)
Returns:
a non-null count

executeQueryUnique

public java.lang.Object executeQueryUnique(java.lang.String sqlNamespace,
                                           java.lang.String queryName,
                                           java.lang.Object parameterObj)
Description copied from interface: CannedQueryDAO
Execute a query that returns exactly one result. The assumption is that the parameters provided uniquely identify the object.

Parameters:
sqlNamespace - the query namespace (defined by config file) e.g. alfresco.query.usage
queryName - the name of the query e.g. select_userCount
parameterObj - the values to drive the selection (may be null if not required)
Returns:
the unique result (never null)

executeQuery

public java.util.List executeQuery(java.lang.String sqlNamespace,
                                   java.lang.String queryName,
                                   java.lang.Object parameterObj,
                                   int offset,
                                   int limit)
Description copied from interface: CannedQueryDAO
Execute a query that returns one or more results.

Parameters:
sqlNamespace - the query namespace (defined by config file) e.g. alfresco.query.usage
queryName - the name of the query e.g. select_userCount
parameterObj - the values to drive the selection (may be null if not required)
offset - the number of results to skip
limit - the maximum number of results to retrieve or Integer.MAX_VALUE for no limit
Returns:
the list of results

executeQuery

public void executeQuery(java.lang.String sqlNamespace,
                         java.lang.String queryName,
                         java.lang.Object parameterObj,
                         int offset,
                         int limit,
                         CannedQueryDAO.ResultHandler handler)
Description copied from interface: CannedQueryDAO
Execute a query that returns one or more results, processing the results using a handler.

Parameters:
sqlNamespace - the query namespace (defined by config file) e.g. alfresco.query.usage
queryName - the name of the query e.g. select_userCount
parameterObj - the values to drive the selection (may be null if not required)
offset - the number of results to skip
limit - the maximum number of results to retrieve or Integer.MAX_VALUE for no limit


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.