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:
- 
- Job
 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.intcount()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.setEndDate(Date date) Set the job create time end date filter, where jobs must have been created before the specified date.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 create time start date filter, where jobs must have been created at or after the specified date.Set the job status query parameter.setUserLoginName(String userLoginName) Set the job transaction user's login name (username).
- 
Constructor Details- 
JobQuery
 
- 
- 
Method Details- 
setIdSet the job id (PK) query parameter.- Parameters:
- id- the job id (PK) query parameter
- Returns:
- the job query
 
- 
setJobStepIdSet the job step id query parameter.- Parameters:
- jobStepId- the job step id (PK) query parameter
- Returns:
- the job query
- Since:
- 19.5.0
 
- 
setJobStepSet the job step query parameter.- Parameters:
- jobStep- the job step query parameter
- Returns:
- the job query
- Since:
- 19.5.0
 
- 
setJobActionIdSet the job action id query parameter.- Parameters:
- jobActionId- the job action id (PK) query parameter
- Returns:
- the job query
- Since:
- 19.5.0
 
- 
setJobActionSet the job action query parameter.- Parameters:
- jobAction- the job action query parameter
- Returns:
- the job query
- Since:
- 19.5.0
 
- 
setNameSet 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
 
- 
setJobKeySet the job key query parameter.- Parameters:
- jobKey- the job key query parameter
- Returns:
- the job query
 
- 
setStatusSet the job status query parameter.- Parameters:
- status- the job status query parameter
- Returns:
- the job query
 
- 
setReferenceNumberSet the job reference number query parameter.- Parameters:
- referenceNumber- the job reference number query parameter
- Returns:
- the job query
 
- 
setUserLoginNameSet 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
 
- 
addGroupAdd 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
 
- 
hasPropertySet job property name parameter.- Parameters:
- name- the property name query parameter
- Returns:
- the job query
- Since:
- 17.10.0
 
- 
hasPropertyValueSet job property value parameter.- Parameters:
- value- the property value query parameter
- Returns:
- the job query
- Since:
- 17.10.0
 
- 
hasNoPropertySet 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
 
- 
hasPropertyNameValueSet property name/value parameter.- Parameters:
- name- the property name query parameter
- value- the property value query parameter
- Returns:
- the job query
- Since:
- 19.05
 
- 
setStartDateSet the job create time start date filter, where jobs must have been created at or after the specified date.- Parameters:
- date- the job creation time start date filter
- Returns:
- the job query
- Since:
- 17.10.0
 
- 
setEndDateSet the job create time end date filter, where jobs must have been created before the specified date.- Parameters:
- date- the job creation time end date filter
- Returns:
- the job query
- Since:
- 17.10.0
 
- 
setFetchLimitSet 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
 
- 
addOrderByAscAdd the sort order by ascending to the query.- Parameters:
- orderProperty- the property to sort by (required)
- Returns:
- the job query
 
- 
addOrderByDescAdd the sort order by descending to the query.- Parameters:
- orderProperty- the property to sort by (required)
- Returns:
- the job query
 
- 
countpublic 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
 
- 
listValuesExecute the job query and return a list of Job value objects.- Returns:
- execute the job query and return a list of Job value objects
 
- 
listJsonExecute the query and return an jobs JSON array list.- Returns:
- execute the query and return an jobs JSON array list
 
- 
firstValueExecute 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
 
- 
firstJsonExecute the query and return the first job JSON value.- Returns:
- execute the query and return the first job JSON value
 
 
-