Package com.avoka.tm.query
Class JobQuery
java.lang.Object
com.avoka.tm.query.JobQuery
Provides a job value object query class.
Examples
Please find the job query examples about list, get first and count below.
Job Query List Example
This Groovy example shows how to list jobs matching certain criteria ordered descending by id (maximum number of 4 records).
import com.avoka.tm.query.* import com.avoka.tm.vo.* String jobName = "job name..." List<Job> jobs = new JobQuery() .setName(jobName) .setStatus(Job.STATUS_IN_PROGRESS) .addOrderByDesc("timeLastProcessed") .setFetchLimit(100) .listValues() // In JSON format String jobsJson = new JobQuery() .setName(jobName) .setStatus(Job.STATUS_IN_PROGRESS) .addOrderByDesc("timeLastProcessed") .setFetchLimit(100) .listJson()
Job Query First Example
This Groovy example shows how to get first job matching certain criteria ordered descending by id.
import com.avoka.tm.query.* import com.avoka.tm.vo.* Job job = new JobQuery() .setName(jobName) .addOrderByDesc("id") .firstValue() // In JSON format String jobJson = new JobQuery() .setName(jobName) .setStatus(Job.STATUS_COMPLETED) .firstJson()
Job Query Count Example
This Groovy example shows how to count all jobs matching certain criteria.
import com.avoka.tm.query.* import com.avoka.tm.vo.* int jobInStatusCount = new JobQuery() .setStatus(Job.STATUS_IN_PROGRESS) .count()
- Since:
- 5.0.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The startDate and endDate filter time type. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd the group name to the job query so that only jobs belonging to the job group are included.addOrderByAsc
(String orderProperty) Add the sort order by ascending to the query.addOrderByDesc
(String orderProperty) Add the sort order by descending to the query.int
count()
Execute a select count query and return the total number of records selected by the query.Execute the query and return the first job JSON value.Execute the query and return the first job value object for the query.hasNoProperty
(String name) Set has not job property name query filter parameter.hasProperty
(String name) Set job property name parameter.hasPropertyNameValue
(String name, String value) Set property name/value parameter.hasPropertyValue
(String value) Set job property value parameter.listJson()
Execute the query and return an jobs JSON array list.Execute the job query and return a list of Job value objects.setClientCode
(String clientCode) Set the job related client code query parametersetControllerServiceId
(Long controllerServiceId) Set the job controller service id query parameter.setEndDate
(Date date) Set the job time end date filter (defaults to created time).setFetchLimit
(int fetchLimit) Set the query fetch limit to limit the maximum number of records returned.Set the job id (PK) query parameter.setJobAction
(com.avoka.fc.core.entity.JobAction jobAction) Set the job action query parameter.setJobActionId
(Long jobActionId) Set the job action id query parameter.Set the job key query parameter.setJobStep
(com.avoka.fc.core.entity.JobStep jobStep) Set the job step query parameter.setJobStepId
(Long jobStepId) Set the job step id query parameter.Set the job name query parameter.setReferenceNumber
(String referenceNumber) Set the job reference number query parameter.setStartDate
(Date date) Set the job time start date filter (defaults to created time).Set the job status query parameter.setTime
(JobQuery.Time time) setUserLoginName
(String userLoginName) Set the job transaction user's login name (username).
-
Constructor Details
-
JobQuery
-
-
Method Details
-
setControllerServiceId
Set the job controller service id query parameter.- Parameters:
controllerServiceId
- the job controller service id query parameter- Returns:
- the job query
- Since:
- 23.10.0
-
setClientCode
Set the job related client code query parameter- Parameters:
clientCode
- the job related client code query parameter- Returns:
- the job query
- Since:
- 23.10.0
-
setId
Set the job id (PK) query parameter.- Parameters:
id
- the job id (PK) query parameter- Returns:
- the job query
-
setJobStepId
Set the job step id query parameter.- Parameters:
jobStepId
- the job step id (PK) query parameter- Returns:
- the job query
- Since:
- 19.5.0
-
setJobStep
Set the job step query parameter.- Parameters:
jobStep
- the job step query parameter- Returns:
- the job query
- Since:
- 19.5.0
-
setJobActionId
Set the job action id query parameter.- Parameters:
jobActionId
- the job action id (PK) query parameter- Returns:
- the job query
- Since:
- 19.5.0
-
setJobAction
Set the job action query parameter.- Parameters:
jobAction
- the job action query parameter- Returns:
- the job query
- Since:
- 19.5.0
-
setName
Set the job name query parameter. If the name parameter include % then perform a like name query, otherwise perform an exact name match.- Parameters:
name
- the job name query parameter- Returns:
- the job query
-
setJobKey
Set the job key query parameter.- Parameters:
jobKey
- the job key query parameter- Returns:
- the job query
-
setStatus
Set the job status query parameter.- Parameters:
status
- the job status query parameter- Returns:
- the job query
-
setReferenceNumber
Set the job reference number query parameter.- Parameters:
referenceNumber
- the job reference number query parameter- Returns:
- the job query
-
setUserLoginName
Set the job transaction user's login name (username).- Parameters:
userLoginName
- the job transaction user's login name (username).- Returns:
- the job query
- Since:
- 18.11.0
-
addGroup
Add the group name to the job query so that only jobs belonging to the job group are included. Filtering on multiple groups is supported.- Parameters:
groupName
- the group name to query parameter- Returns:
- the job query
- Since:
- 17.10.0
-
hasProperty
Set job property name parameter.- Parameters:
name
- the property name query parameter- Returns:
- the job query
- Since:
- 17.10.0
-
hasPropertyValue
Set job property value parameter.- Parameters:
value
- the property value query parameter- Returns:
- the job query
- Since:
- 17.10.0
-
hasNoProperty
Set has not job property name query filter parameter.- Parameters:
name
- the has not property name query parameter- Returns:
- the job query
- Since:
- 17.10.0
-
hasPropertyNameValue
Set property name/value parameter.- Parameters:
name
- the property name query parametervalue
- the property value query parameter- Returns:
- the job query
- Since:
- 19.05
-
setStartDate
Set the job time start date filter (defaults to created time).- Parameters:
date
- the job start date filter (defaults to created time)- Returns:
- the job query
- Since:
- 23.10.0
-
setEndDate
Set the job time end date filter (defaults to created time).- Parameters:
date
- the job end date filter (defaults to created time)- Returns:
- the job query
- Since:
- 23.10.0
-
setTime
- Parameters:
time
- the time to set (defaults to created time)- Returns:
- the job query
- Since:
- 23.10.0
-
setFetchLimit
Set the query fetch limit to limit the maximum number of records returned. The default query fetch limit is 100 records.- Parameters:
fetchLimit
- the query fetch limit- Returns:
- the job query
-
addOrderByAsc
Add the sort order by ascending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the job query
-
addOrderByDesc
Add the sort order by descending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the job query
-
count
public int count()Execute a select count query and return the total number of records selected by the query.- Returns:
- the total number of records selected by the query
-
listValues
Execute the job query and return a list of Job value objects.- Returns:
- execute the job query and return a list of Job value objects
-
listJson
Execute the query and return an jobs JSON array list.- Returns:
- execute the query and return an jobs JSON array list
-
firstValue
Execute the query and return the first job value object for the query.- Returns:
- execute the query and return the first job value object for the query
-
firstJson
Execute the query and return the first job JSON value.- Returns:
- execute the query and return the first job JSON value
-