Class AbstractNativeQuery<T extends NativeQuery<?,?>,U>

java.lang.Object
org.flowable.common.engine.impl.query.BaseNativeQuery<T,U>
org.flowable.common.engine.impl.query.AbstractNativeQuery<T,U>
All Implemented Interfaces:
Serializable, NativeQuery<T,U>, Command<Object>
Direct Known Subclasses:
NativeActivityInstanceQueryImpl, NativeDecisionTableQueryImpl, NativeDeploymentQueryImpl, NativeDmnDeploymentQueryImpl, NativeExecutionQueryImpl, NativeGroupQueryImpl, NativeHistoricActivityInstanceQueryImpl, NativeHistoricDetailQueryImpl, NativeHistoricProcessInstanceQueryImpl, NativeHistoricTaskInstanceQueryImpl, NativeHistoricTaskLogEntryQueryImpl, NativeHistoricVariableInstanceQueryImpl, NativeHistoryDecisionExecutionQueryImpl, NativeModelQueryImpl, NativeProcessDefinitionQueryImpl, NativeProcessInstanceQueryImpl, NativeTaskQueryImpl, NativeTokenQueryImpl, NativeUserQueryImpl, NativeVariableInstanceQueryImpl

public abstract class AbstractNativeQuery<T extends NativeQuery<?,?>,U> extends BaseNativeQuery<T,U> implements Command<Object>
Abstract superclass for all native query types.
Author:
Bernd Ruecker (camunda)
See Also:
  • Field Details

  • Constructor Details

    • AbstractNativeQuery

      protected AbstractNativeQuery(CommandExecutor commandExecutor)
    • AbstractNativeQuery

      public AbstractNativeQuery(CommandContext commandContext)
  • Method Details

    • setCommandExecutor

      public AbstractNativeQuery<T,U> setCommandExecutor(CommandExecutor commandExecutor)
    • sql

      public T sql(String sqlStatement)
      Description copied from interface: NativeQuery
      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 Flowable 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)
      Specified by:
      sql in interface NativeQuery<T extends NativeQuery<?,?>,U>
      Overrides:
      sql in class BaseNativeQuery<T extends NativeQuery<?,?>,U>
    • parameter

      public T parameter(String name, Object value)
      Description copied from interface: NativeQuery
      Add parameter to be replaced in query for index, e.g. :param1, :myParam, ...
      Specified by:
      parameter in interface NativeQuery<T extends NativeQuery<?,?>,U>
      Overrides:
      parameter in class BaseNativeQuery<T extends NativeQuery<?,?>,U>
    • singleResult

      public U singleResult()
      Description copied from interface: NativeQuery
      Executes the query and returns the resulting entity or null if no entity matches the query criteria.
      Specified by:
      singleResult in interface NativeQuery<T extends NativeQuery<?,?>,U>
    • list

      public List<U> list()
      Description copied from interface: NativeQuery
      Executes the query and get a list of entities as the result.
      Specified by:
      list in interface NativeQuery<T extends NativeQuery<?,?>,U>
    • listPage

      public List<U> listPage(int firstResult, int maxResults)
      Description copied from interface: NativeQuery
      Executes the query and get a list of entities as the result.
      Specified by:
      listPage in interface NativeQuery<T extends NativeQuery<?,?>,U>
    • count

      public long count()
      Description copied from interface: NativeQuery
      Executes the query and returns the number of results
      Specified by:
      count in interface NativeQuery<T extends NativeQuery<?,?>,U>
    • execute

      public Object execute(CommandContext commandContext)
      Specified by:
      execute in interface Command<T extends NativeQuery<?,?>>
    • executeCount

      public abstract long executeCount(CommandContext commandContext, Map<String,Object> parameterMap)
    • executeList

      public abstract List<U> executeList(CommandContext commandContext, Map<String,Object> parameterMap)
      Executes the actual query to retrieve the list of results.
      Parameters:
      commandContext -
      parameterMap -
    • executeSingleResult

      public U executeSingleResult(CommandContext commandContext)