Package com.avoka.tm.query
Class LogQuery
java.lang.Object
com.avoka.tm.query.LogQuery
Provides a log value object query class.
Examples
Please find the log query examples listValues and listJson with type ErrorLog.
Log Query List Example
This Groovy example shows how to list error logs sorted by name, with the result set limited to a maximum of 50 records.
 import com.avoka.tm.query.*
 import com.avoka.tm.vo.*
 List<Log> logs = new LogQuery()
     .setLogType("ErrorLog)
     .addOrderByAsc("name")
     .setFetchLimit(50)
     .listValues()
 // In JSON format
 String logJson = new LogQuery()
     .setLogType("ErrorLog)
     .addOrderByAsc("name")
     .setFetchLimit(50)
     .listJson()  
 Log Query First Example
This Groovy example shows how to get first audit log matching certain criteria.
 import com.avoka.tm.query.*
 import com.avoka.tm.vo.*
 Log log = new LogQuery()
     .setLogType("AuditLog")
     .setId(1L)
     .firstValue()
 //By name criteria
 Log log = new LogQuery()
      .setLogType("AuditLog")
      .setName("testName")
      .firstValue() 
 Log Query Count Example
This Groovy example shows how to count all Event Logs.
 import com.avoka.tm.query.*
 int eventLogCount = new LogQuery()
     .setLogType("EventLog")
     .count()  - Since:
- 23.4.0
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddOrderByAsc(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 Log JSON value.Execute the query and return the first Log value object for the query.listJson()Execute the query and return a Log JSON array list.Execute the log query and return a list of log value objects.setEntityName(String entityName) Set the log entityName query parameter.setErrorType(String errorType) Set the log errorType query parameter.setEventType(String eventType) Set the log eventType query parameter.setFetchLimit(int fetchLimit) Set the query fetch limit to limit the maximum number of records returned.Set the log formId query parameter.Set the log id (PK) query parameter.setLogType(String logType) Set the log type query parameter.Set the log name query parameter.setServiceId(Long serviceId) Set the log serviceId query parameter.setSubmissionId(Long submissionId) Set the log submissionId query parameter.Set the log userId query parameter.setUserName(String userName) Set the log userName query parameter.
- 
Constructor Details- 
LogQuerypublic LogQuery()
 
- 
- 
Method Details- 
setIdSet the log id (PK) query parameter.- Parameters:
- id- the log id (PK) query parameter
- Returns:
- the log query
 
- 
setNameSet the log name query parameter.- Parameters:
- name- the log name query parameter
- Returns:
- the log query
 
- 
setLogTypeSet the log type query parameter.- Parameters:
- logType- the log type query parameter
- Returns:
- the log query
 
- 
setUserNameSet the log userName query parameter.- Parameters:
- userName- the log userName query parameter
- Returns:
- the log query
 
- 
setErrorTypeSet the log errorType query parameter.- Parameters:
- errorType- the log errorType query parameter
- Returns:
- the log query
 
- 
setSubmissionIdSet the log submissionId query parameter.- Parameters:
- submissionId- the log submissionId query parameter
- Returns:
- the log query
 
- 
setEventTypeSet the log eventType query parameter.- Parameters:
- eventType- the log eventType query parameter
- Returns:
- the log query
 
- 
setServiceIdSet the log serviceId query parameter.- Parameters:
- serviceId- the log serviceId query parameter
- Returns:
- the log query
 
- 
setFormIdSet the log formId query parameter.- Parameters:
- formId- the log formId query parameter
- Returns:
- the log query
 
- 
setEntityNameSet the log entityName query parameter.- Parameters:
- entityName- the log entityName query parameter
- Returns:
- the log query
 
- 
setUserIdSet the log userId query parameter.- Parameters:
- userId- the log userId query parameter
- Returns:
- the log query
 
- 
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 log query
 
- 
addOrderByAscAdd the sort order by ascending to the query.- Parameters:
- orderProperty- the property to sort by (required)
- Returns:
- the Log query
 
- 
addOrderByDescAdd the sort order by descending to the query.- Parameters:
- orderProperty- the property to sort by (required)
- Returns:
- the Log 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 log query and return a list of log value objects.- Returns:
- execute the log query and return a list of log value objects
 
- 
listJsonExecute the query and return a Log JSON array list.- Returns:
- execute the query and return a Log JSON array list
 
- 
firstValueExecute the query and return the first Log value object for the query.- Returns:
- execute the query and return the first Log value object for the query
 
- 
firstJsonExecute the query and return the first Log JSON value.- Returns:
- execute the query and return the first Log JSON value
 
 
-