Class CaseQuery
- java.lang.Object
-
- ch.ivyteam.ivy.persistence.query.Query<ICase>
-
- ch.ivyteam.ivy.workflow.query.CaseQuery
-
- Direct Known Subclasses:
CaseQuery.AggregationQuery
,CaseQuery.FilterLink
,CaseQuery.GroupByQuery
,CaseQuery.OrderByQuery
@Generated(value="ch.ivyteam.db.meta.generator.internal.query.JavaQueryClassGenerator", date="Jun 6, 2023, 3:44:19 AM") public class CaseQuery extends Query<ICase>
Provides a query builder to query
case
data.To execute the query use
ICaseQueryExecutor
. Seeivy.wf.getCaseQueryExecutor()
Example how to filter and order data:
Example how to aggregate and group data:import ch.ivyteam.ivy.workflow.query.CaseQuery; CaseQuery caseQuery = CaseQuery.businessCases(); List<ICase> cases = caseQuery.where().customVarCharField1().isEqual("Hello") .and().customVarCharField2().isEqual("World") .orderBy().name().ascending() .executor().results();
import ch.ivyteam.ivy.workflow.query.CaseQuery; CaseQuery caseQuery = CaseQuery.businessCases(); Recordset recordset = caseQuery.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 class
CaseQuery.AggregationQuery
This class provides methods to perform aggregations on the query.static class
CaseQuery.FilterLink
Links a where condition with another.static class
CaseQuery.FilterQuery
Provides filter functionality forICase
static class
CaseQuery.GroupByQuery
Provides methods to group the result by certain fields.static interface
CaseQuery.IAggregationQuery
Provides methods to perform aggregations on the query.static interface
CaseQuery.ICaseStateFilterQuery
static interface
CaseQuery.IClobColumnFilterQuery
static interface
CaseQuery.IColumnFilterQuery
Basic filter functionality provider for a column ofICase
static interface
CaseQuery.ICustomFieldAggregationQuery
Provides aggregation functionality for custom fields ofICase
.static interface
CaseQuery.ICustomFieldFilterQuery
Provides filter functionality for custom fields ofICase
.static interface
CaseQuery.ICustomFieldGroupBy
Provides grouping functionality for custom fields ofICase
.static interface
CaseQuery.ICustomFieldOrderBy
Provides ordering functionality for custom fields ofICase
.static interface
CaseQuery.IDateColumnFilterQuery
Provides filter functionality for a date column ofICase
static interface
CaseQuery.IFilterableColumns
Provides filter functionality forICase
static interface
CaseQuery.IFilterLink
Links a where condition with another.static interface
CaseQuery.IFilterQuery
Provides filter functionality forICase
static interface
CaseQuery.IGroupByQueryColumns
Provides methods to group the result by certain fields.static interface
CaseQuery.IIntegerColumnFilterQuery
Provides filter functionality for an integer column ofICase
static interface
CaseQuery.INumberColumnFilterQuery
Provides filter functionality for a decimal number column ofICase
static interface
CaseQuery.IOrderByQueryColumns
Provides methods to order the result by columns ofICase
.static interface
CaseQuery.IPatternColumnFilterQuery
Provides filter functionality for columns ofICase
that can be filter by string patterns (isLike)static interface
CaseQuery.IStringColumnFilterQuery
Provides filter functionality for a string column ofICase
static interface
CaseQuery.IWorkflowPriorityFilterQuery
Provides filter functionality for aWorkflowPriority
column ofICase
static class
CaseQuery.OrderByColumnQuery
Provides methods to define the direction of the sorting either ascending or descending.static class
CaseQuery.OrderByQuery
Provides methods to order the result by columns ofICase
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CaseQuery.IAggregationQuery
aggregate()
Returns an object which contains the aggregation part for this query.
It provides methods to perform aggregations on the query.static CaseQuery
businessCases()
Creates a new query that only returns business cases.static CaseQuery
create()
Creates a new query
For performance reasons you should always preferbusinessCases()
orsubCases()
if you only need one of those.IFluentQueryExecutor<ICase>
executor()
Provides a fluent API to execute this query and fetch its results.CaseQuery.IGroupByQueryColumns
groupBy()
Returns an object which contains the group by part for this query.
It provides methods to group the result by certain fields.CaseQuery.IOrderByQueryColumns
orderBy()
Returns an object which contains the order by part for this query.
It provides methods to order the result by certain columns.static CaseQuery
subCases()
Creates a new query that only returns sub cases (technical cases).CaseQuery.IFilterQuery
where()
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 CaseQuery create()
Creates a new query
For performance reasons you should always preferbusinessCases()
orsubCases()
if you only need one of those.- Returns:
- A new instance of CaseQuery
- See Also:
businessCases()
,subCases()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
businessCases
public static CaseQuery businessCases()
Creates a new query that only returns business cases.- Returns:
- A new instance of CaseQuery
- See Also:
subCases()
,create()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
subCases
public static CaseQuery subCases()
Creates a new query that only returns sub cases (technical cases).- Returns:
- A new instance of CaseQuery
- See Also:
businessCases()
,create()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
executor
public IFluentQueryExecutor<ICase> 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 CaseQuery.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:CaseQuery.businessCases().aggregate().sumWorkingTime().avgWorkingTime();
SELECT SUM(WorkingTime) AS SumWorkingTime, AVG(WorkingTime) AS AvgWorkingTime FROM IWA_Case
- Returns:
- aggregate query
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
groupBy
public CaseQuery.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:CaseQuery.businessCases().groupBy().ownerRoleId().ownerName().aggregate().countRows();
SELECT OwnerRoleId, OwnerUserId, Count(*) AS Count FROM IWA_Case GROUP BY OwnerRoleId, OwnerUserId
- Returns:
- A query group by builder to add group by statements
- See Also:
CaseQuery.AggregationQuery.countRows()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
orderBy
public CaseQuery.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 CaseQuery.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.
-
-