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="Aug 13, 2021, 10:26:46 AM") public class CaseQuery extends Query<ICase>Provides a query builder to query
casedata.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 classCaseQuery.AggregationQueryThis class provides methods to perform aggregations on the query.static classCaseQuery.FilterLinkLinks a where condition with another.static classCaseQuery.FilterQueryProvides filter functionality forICasestatic classCaseQuery.GroupByQueryProvides methods to group the result by certain fields.static interfaceCaseQuery.IAggregationQueryProvides methods to perform aggregations on the query.static interfaceCaseQuery.IBoolFilterQuerystatic interfaceCaseQuery.ICaseStateFilterQuerystatic interfaceCaseQuery.IClobColumnFilterQuerystatic interfaceCaseQuery.IColumnFilterQueryBasic filter functionality provider for a column ofICasestatic interfaceCaseQuery.ICustomFieldAggregationQueryProvides aggregation functionality for custom fields ofICase.static interfaceCaseQuery.ICustomFieldFilterQueryProvides filter functionality for custom fields ofICase.static interfaceCaseQuery.ICustomFieldGroupByProvides grouping functionality for custom fields ofICase.static interfaceCaseQuery.ICustomFieldOrderByProvides ordering functionality for custom fields ofICase.static interfaceCaseQuery.IDateColumnFilterQueryProvides filter functionality for a date column ofICasestatic interfaceCaseQuery.IFilterableColumnsProvides filter functionality forICasestatic interfaceCaseQuery.IFilterLinkLinks a where condition with another.static interfaceCaseQuery.IFilterQueryProvides filter functionality forICasestatic interfaceCaseQuery.IGroupByQueryColumnsProvides methods to group the result by certain fields.static interfaceCaseQuery.IIntegerColumnFilterQueryProvides filter functionality for an integer column ofICasestatic interfaceCaseQuery.INumberColumnFilterQueryProvides filter functionality for a decimal number column ofICasestatic interfaceCaseQuery.IOrderByQueryColumnsProvides methods to order the result by columns ofICase.static interfaceCaseQuery.IPatternColumnFilterQueryProvides filter functionality for columns ofICasethat can be filter by string patterns (isLike)static interfaceCaseQuery.IStringColumnFilterQueryProvides filter functionality for a string column ofICasestatic interfaceCaseQuery.IWorkflowPriorityFilterQueryProvides filter functionality for aWorkflowPrioritycolumn ofICasestatic classCaseQuery.OrderByColumnQueryProvides methods to define the direction of the sorting either ascending or descending.static classCaseQuery.OrderByQueryProvides methods to order the result by columns ofICase.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CaseQuery.IAggregationQueryaggregate()Returns an object which contains the aggregation part for this query.
It provides methods to perform aggregations on the query.static CaseQuerybusinessCases()Creates a new query that only returns business cases.static CaseQuerycreate()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.IGroupByQueryColumnsgroupBy()Returns an object which contains the group by part for this query.
It provides methods to group the result by certain fields.CaseQuery.IOrderByQueryColumnsorderBy()Returns an object which contains the order by part for this query.
It provides methods to order the result by certain columns.static CaseQuerysubCases()Creates a new query that only returns sub cases (technical cases).CaseQuery.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 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.
-
-