Class FormQuery
Provides a form value object query class.
Examples
Please find the form query examples of listValues and listJson below.
Form Query List Example
This Groovy example shows how to list forms 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 forms = new FormQuery() .addOrderByAsc("name") .setFetchLimit(50) .listValues()
// In JSON format String FormsJson = new FormQuery() .addOrderByAsc("name") .setFetchLimit(50) .listJson()
Form Query First Example
This Groovy example shows how to get first form matching certain criteria.
import com.avoka.tm.query.* import com.avoka.tm.vo.*Form form = new FormQuery() .setId(1L) .firstValue()
//By name criteria Form form = new FormQuery() .setName("testName") .firstValue()
Form count query Example
This Groovy example shows how to count all forms.
import com.avoka.tm.query.*int formCount = new FormQuery() .count()
- Since:
- 23.10.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 form value object for the query.listJson()
Execute the query and return a form JSON array list.Execute the form query and return a list of form value objects.Execute the form query and return a list of Form value objects the authenticated user is permitted to render.setCategoryName
(String categoryName) Set the category name parameter.setCategoryNames
(Set<String> categoryNames) Set the category name list parameter.setClientCode
(String clientCode) Set the form client code query parameter.setFetchLimit
(int fetchLimit) Set the query fetch limit to limit the maximum number of records returned.setFormCode
(String formCode) Set the form code parameter.Set the form id (PK) query parameter.setIncludeAllForms
(boolean includeAllForms) Set the includeAllForms parameter.Set the name parameter.setRequest
(jakarta.servlet.http.HttpServletRequest request) Set the request parameter.setSpaceName
(String spaceName) Set the SpaceName parameter.Set the query to return the spaces associated with the form.
-
Constructor Details
-
FormQuery
-
-
Method Details
-
setId
Set the form id (PK) query parameter.- Parameters:
id
- the form id (PK) query parameter- Returns:
- the form query
-
setFormCode
Set the form code parameter.- Parameters:
formCode
- the form code- Returns:
- the form query
-
setName
Set the name parameter.- Parameters:
name
- the form name query parameter- Returns:
- the form query
-
setClientCode
Set the form client code query parameter.- Parameters:
clientCode
- the form client code query parameter- Returns:
- the form query
-
setCategoryName
Set the category name parameter.- Parameters:
categoryName
- the category name- Returns:
- the form query
-
setCategoryNames
Set the category name list parameter.- Parameters:
categoryNames
- the category names- Returns:
- the form query
-
setSpaceName
Set the SpaceName parameter.- Parameters:
spaceName
- of the hosting Form Space- Returns:
- the form query
-
setRequest
Set the request parameter.- Parameters:
request
- the servlet request- Returns:
- the form query
-
setIncludeAllForms
Set the includeAllForms parameter. If it sets to true, query includes all inactive clients, inactive or testEnabledFlag form. The default value is false.- Parameters:
includeAllForms
- the includeAllForms parameter.If it sets to true, query includes all inactive clients, inactive or testEnabledFlag form- Returns:
- the form 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 form query
-
withSpaces
Set the query to return the spaces associated with the form.- Returns:
- the form query.
- Since:
- 23.10.0
-
addOrderByAsc
Add the sort order by ascending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the form query
-
addOrderByDesc
Add the sort order by descending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the form query
-
count
public int count()Execute a select count query and return the total number of records selected by the query.- Returns:
- Execute a select count query and return the total number of records selected by the query.
-
listJson
Execute the query and return a form JSON array list.- Returns:
- execute the query and return a form JSON array list.
-
firstValue
Execute the query and return the first form value object for the query.- Returns:
- execute the query and return the first form value object for the query.
-
listValues
Execute the form query and return a list of form value objects.- Returns:
- Execute the form query and return a list of form value objects.
-
listValuesForAuthorizedAccess
Execute the form query and return a list of Form value objects the authenticated user is permitted to render.- Returns:
- execute the form query and return a list of Form value objects
-