org.activiti.engine.query
接口 NativeQuery<T extends NativeQuery<?,?>,U>

所有已知子接口:
NativeDeploymentQuery, NativeExecutionQuery, NativeGroupQuery, NativeHistoricActivityInstanceQuery, NativeHistoricDetailQuery, NativeHistoricProcessInstanceQuery, NativeHistoricTaskInstanceQuery, NativeHistoricVariableInstanceQuery, NativeModelQuery, NativeProcessDefinitionQuery, NativeProcessInstanceQuery, NativeTaskQuery, NativeUserQuery
所有已知实现类:
AbstractNativeQuery, NativeDeploymentQueryImpl, NativeExecutionQueryImpl, NativeGroupQueryImpl, NativeHistoricActivityInstanceQueryImpl, NativeHistoricDetailQueryImpl, NativeHistoricProcessInstanceQueryImpl, NativeHistoricTaskInstanceQueryImpl, NativeHistoricVariableInstanceQueryImpl, NativeModelQueryImpl, NativeProcessDefinitionQueryImpl, NativeProcessInstanceQueryImpl, NativeTaskQueryImpl, NativeUserQueryImpl

public interface NativeQuery<T extends NativeQuery<?,?>,U>

Describes basic methods for doing native queries

作者:
Bernd Ruecker (camunda)

方法摘要
 long count()
          Executes the query and returns the number of results
 List<U> list()
          Executes the query and get a list of entities as the result.
 List<U> listPage(int firstResult, int maxResults)
          Executes the query and get a list of entities as the result.
 T parameter(String name, Object value)
          Add parameter to be replaced in query for index, e.g.
 U singleResult()
          Executes the query and returns the resulting entity or null if no entity matches the query criteria.
 T sql(String selectClause)
          Hand in the SQL statement you want to execute.
 

方法详细信息

sql

T sql(String selectClause)
Hand in the SQL statement you want to execute. BEWARE: if you need a count you have to hand in a count() statement yourself, otherwise the result will be treated as lost of Activiti entities. If you need paging you have to insert the pagination code yourself. We skipped doing this for you as this is done really different on some databases (especially MS-SQL / DB2)


parameter

T parameter(String name,
            Object value)
Add parameter to be replaced in query for index, e.g. :param1, :myParam, ...


count

long count()
Executes the query and returns the number of results


singleResult

U singleResult()
Executes the query and returns the resulting entity or null if no entity matches the query criteria.

抛出:
ActivitiException - when the query results in more than one entities.

list

List<U> list()
Executes the query and get a list of entities as the result.


listPage

List<U> listPage(int firstResult,
                 int maxResults)
Executes the query and get a list of entities as the result.



Copyright © 2013 Alfresco. All rights reserved.