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.* import com.avoka.tm.vo.* int eventLogCount = new LogQuery() .setLogType("EventLog") .count()
Log Query First JSON Example
This Groovy example shows how to get first request log JSON matching certain criteria.
import com.avoka.tm.query.* import com.avoka.tm.vo.* int requestLogJson = new LogQuery() .setLogType("RequestLog") .setRenderMode("Form") .firstJson()
- Since:
- 23.4.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier 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.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 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.setClientCode
(String clientCode) Set the log clientCode query parameter.setEntityName
(String entityName) Set the log entityName query parameter.setErrorId
(Long errorId) Set the log errorId 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.setPortalName
(String portalName) Set the log portalName query parameter.setRenderMode
(String renderMode) Set the log renderMode query parameter.setRequestKey
(String requestKey) Set the log requestKey query parameter.setSecurityManagerName
(String securityManagerName) Set the log securityManagerName 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
-
LogQuery
public LogQuery()
-
-
Method Details
-
setId
Set the log id (PK) query parameter.- Parameters:
id
- the log id (PK) query parameter- Returns:
- the log query
-
setClientCode
Set the log clientCode query parameter.- Parameters:
clientCode
- the log clientCode query parameter- Returns:
- the log query
- Since:
- 23.10.0
-
setErrorId
Set the log errorId query parameter.- Parameters:
errorId
- the log errorId query parameter- Returns:
- the log query
- Since:
- 23.10.0
-
setName
Set the log name query parameter.- Parameters:
name
- the log name query parameter- Returns:
- the log query
-
setLogType
Set the log type query parameter.- Parameters:
logType
- the log type query parameter- Returns:
- the log query
-
setUserName
Set the log userName query parameter.- Parameters:
userName
- the log userName query parameter- Returns:
- the log query
-
setErrorType
Set the log errorType query parameter.- Parameters:
errorType
- the log errorType query parameter- Returns:
- the log query
-
setSecurityManagerName
Set the log securityManagerName query parameter.- Parameters:
securityManagerName
- the log securityManagerName query parameter- Returns:
- the log query
- Since:
- 23.10.0
-
setSubmissionId
Set the log submissionId query parameter.- Parameters:
submissionId
- the log submissionId query parameter- Returns:
- the log query
-
setEventType
Set the log eventType query parameter.- Parameters:
eventType
- the log eventType query parameter- Returns:
- the log query
-
setServiceId
Set the log serviceId query parameter.- Parameters:
serviceId
- the log serviceId query parameter- Returns:
- the log query
-
setFormId
Set the log formId query parameter.- Parameters:
formId
- the log formId query parameter- Returns:
- the log query
-
setEntityName
Set the log entityName query parameter.- Parameters:
entityName
- the log entityName query parameter- Returns:
- the log query
-
setRenderMode
Set the log renderMode query parameter.- Parameters:
renderMode
- the log renderMode query parameter- Returns:
- the log query
- Since:
- 23.10.0
-
setRequestKey
Set the log requestKey query parameter.- Parameters:
requestKey
- the log requestKey query parameter- Returns:
- the log query
- Since:
- 23.10.0
-
setPortalName
Set the log portalName query parameter.- Parameters:
portalName
- the log portalName query parameter- Returns:
- the log query
- Since:
- 23.10.0
-
setUserId
Set the log userId query parameter.- Parameters:
userId
- the log userId query parameter- Returns:
- the log query
-
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 log query
-
addOrderByAsc
Add the sort order by ascending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the Log query
-
addOrderByDesc
Add the sort order by descending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the Log 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 log query and return a list of log value objects.- Returns:
- execute the log query and return a list of log value objects
-
listJson
Execute the query and return a Log JSON array list.- Returns:
- execute the query and return a Log JSON array list
-
firstValue
Execute 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
-
firstJson
Execute the query and return the first Log JSON value.- Returns:
- execute the query and return the first Log JSON value
-