Class FormVersionQuery
Provides a form version value object query class.
Examples
Please find the form version query examples of listValues and listJson below.
Form version Query List Example
This Groovy example shows how to list form versions sorted by version number, with the result set limited to a maximum of 50 records.
import com.avoka.tm.query.* import com.avoka.tm.vo.*List formVersions = new FormVersionQuery() .addOrderByAsc("versionNumber") .setFetchLimit(50) .listValues()
// In JSON format String FormVersionsJson = new FormVersionQuery() .addOrderByAsc("versionNumber") .setFetchLimit(50) .listJson()
Form Version Query First Example
This Groovy example shows how to get first form version matching certain criteria.
import com.avoka.tm.query.* import com.avoka.tm.vo.*FormVersion formVersion = new FormVersionQuery() .setId(1L) .firstValue()
//By form code criteria FormVersion formVersion = new FormVersionQuery() .setFormCode("testName") .firstValue()
Form version count query Example
This Groovy example shows how to count all form versions.
import com.avoka.tm.query.*int formVersionCount = new FormVersionQuery() .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 formVersion value object for the query.listJson()
Execute the query and return a formVersion JSON array list.Execute the form version query and return a list of form version value objects.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 version id (PK) query parameter.Set the includeAllStatus parameter.setVersionNumber
(String versionNumber) Set the version number.
-
Constructor Details
-
FormVersionQuery
-
-
Method Details
-
setId
Set the form version id (PK) query parameter.- Parameters:
id
- the form version id (PK) query parameter- Returns:
- the formVersion query
-
setFormCode
Set the form code parameter.- Parameters:
formCode
- the form code- Returns:
- the formVersion query
-
setVersionNumber
Set the version number.- Parameters:
versionNumber
- the version number- Returns:
- the formVersion query
-
setIncludeAllStatus
Set the includeAllStatus parameter. If it sets to true, query includes all form versions(Active, Offline, Inactive, NoRender).- Returns:
- the formVersion 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 formVersion query
-
addOrderByAsc
Add the sort order by ascending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the formVersion query
-
addOrderByDesc
Add the sort order by descending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the formVersion 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 formVersion JSON array list.- Returns:
- execute the query and return a formVersion JSON array list.
-
firstValue
Execute the query and return the first formVersion value object for the query.- Returns:
- execute the query and return the first formVersion value object for the query.
-
listValues
Execute the form version query and return a list of form version value objects.- Returns:
- Execute the form version query and return a list of form version value objects.
-