Class TaskQuery
- java.lang.Object
-
- ch.ivyteam.ivy.persistence.query.Query<ITask>
-
- ch.ivyteam.ivy.workflow.query.TaskQuery
-
- Direct Known Subclasses:
TaskQuery.AggregationQuery,TaskQuery.FilterLink,TaskQuery.GroupByQuery,TaskQuery.OrderByQuery
@Generated(value="ch.ivyteam.db.meta.generator.internal.query.JavaQueryClassGenerator", date="Aug 13, 2021, 10:26:47 AM") public class TaskQuery extends Query<ITask>Provides a query builder to query
taskdata.To execute the query use
ITaskQueryExecutor. Seeivy.wf.getTaskQueryExecutor()Example how to filter and order data:
Example how to aggregate and group data:import ch.ivyteam.ivy.workflow.query.TaskQuery; TaskQuery taskQuery = TaskQuery.create(); List<ITask> tasks = taskQuery.where().customVarCharField1().isEqual("Hello") .and().customVarCharField2().isEqual("World") .orderBy().name().ascending(); .executor().results();import ch.ivyteam.ivy.workflow.query.TaskQuery; TaskQuery taskQuery = TaskQuery.create(); Recordset recordset = taskQuery.aggregate().sumCustomDecimalField1() .groupBy().customVarCharField1() .executor().recordset(); recordset.getField(0, 0); // Sum of the group recordset.getField(0, 1); // Name of the group
- API:
- This is a public API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTaskQuery.AggregationQueryThis class provides methods to perform aggregations on the query.static classTaskQuery.FilterLinkLinks a where condition with another.static classTaskQuery.FilterQueryProvides filter functionality forITaskstatic classTaskQuery.GroupByQueryProvides methods to group the result by certain fields.static interfaceTaskQuery.IAggregationQueryProvides methods to perform aggregations on the query.static interfaceTaskQuery.IBooleanColumnFilterQueryProvides filter functionality for a boolean column ofITaskstatic interfaceTaskQuery.IBoolFilterQuerystatic interfaceTaskQuery.IClobColumnFilterQuerystatic interfaceTaskQuery.IColumnFilterQueryBasic filter functionality provider for a column ofITaskstatic interfaceTaskQuery.ICustomFieldAggregationQueryProvides aggregation functionality for custom fields ofITask.static interfaceTaskQuery.ICustomFieldFilterQueryProvides filter functionality for custom fields ofITask.static interfaceTaskQuery.ICustomFieldGroupByProvides grouping functionality for custom fields ofITask.static interfaceTaskQuery.ICustomFieldOrderByProvides ordering functionality for custom fields ofITask.static interfaceTaskQuery.IDateColumnFilterQueryProvides filter functionality for a date column ofITaskstatic interfaceTaskQuery.IFilterableColumnsProvides filter functionality forITaskstatic interfaceTaskQuery.IFilterLinkLinks a where condition with another.static interfaceTaskQuery.IFilterQueryProvides filter functionality forITaskstatic interfaceTaskQuery.IGroupByQueryColumnsProvides methods to group the result by certain fields.static interfaceTaskQuery.IIntegerColumnFilterQueryProvides filter functionality for an integer column ofITaskstatic interfaceTaskQuery.INumberColumnFilterQueryProvides filter functionality for a decimal number column ofITaskstatic interfaceTaskQuery.IOrderByQueryColumnsProvides methods to order the result by columns ofITask.static interfaceTaskQuery.IPatternColumnFilterQueryProvides filter functionality for columns ofITaskthat can be filter by string patterns (isLike)static interfaceTaskQuery.IStringColumnFilterQueryProvides filter functionality for a string column ofITaskstatic interfaceTaskQuery.ITaskStateFilterQuerystatic interfaceTaskQuery.IWorkflowPriorityFilterQueryProvides filter functionality for aWorkflowPrioritycolumn ofITaskstatic classTaskQuery.OrderByColumnQueryProvides methods to define the direction of the sorting either ascending or descending.static classTaskQuery.OrderByQueryProvides methods to order the result by columns ofITask.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskQuery.IAggregationQueryaggregate()Returns an object which contains the aggregation part for this query.
It provides methods to perform aggregations on the query.static TaskQuerycreate()Creates a new queryIFluentQueryExecutor<ITask>executor()Provides a fluent API to execute this query and fetch its results.TaskQuery.IGroupByQueryColumnsgroupBy()Returns an object which contains the group by part for this query.
It provides methods to group the result by certain fields.TaskQuery.IOrderByQueryColumnsorderBy()Returns an object which contains the order by part for this query.
It provides methods to order the result by certain columns.TaskQuery.IFilterQuerywhere()Returns an object which contains the where part for this query.
It provides methods to filter the result by certain columns.
-
-
-
Method Detail
-
create
public static TaskQuery create()
Creates a new query- Returns:
- A new instance of TaskQuery
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
executor
public IFluentQueryExecutor<ITask> executor()
Provides a fluent API to execute this query and fetch its results.
- Returns:
- fluent API to execute this query.
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
aggregate
public TaskQuery.IAggregationQuery aggregate()
Returns an object which contains the aggregation part for this query.
It provides methods to perform aggregations on the query. For each aggregation a column is added to the result set.Example:
Corresponds to SQL:TaskQuery.create().aggregate().sumWorkingTime().avgWorkingTime();
SELECT SUM(WorkingTime) AS SumWorkingTime, AVG(WorkingTime) AS AvgWorkingTime FROM IWA_Task
- Returns:
- aggregate query
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
groupBy
public TaskQuery.IGroupByQueryColumns groupBy()
Returns an object which contains the group by part for this query.
It provides methods to group the result by certain fields.Example:
Corresponds to SQL:TaskQuery.create().groupBy().activatorUserId().priority().aggregate().countRows();
SELECT ActivatorUserId, Priority, Count(*) AS Count FROM IWA_Task GROUP BY ActivatorUserId, Priority
- Returns:
- A query group by builder to add group by statements
- See Also:
TaskQuery.AggregationQuery.countRows()- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
orderBy
public TaskQuery.IOrderByQueryColumns orderBy()
Returns an object which contains the order by part for this query.
It provides methods to order the result by certain columns.- Returns:
- An order by query builder to add order by statements
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
where
public TaskQuery.IFilterQuery where()
Returns an object which contains the where part for this query.
It provides methods to filter the result by certain columns.- Returns:
- An filter query builder to add where statements
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
-