Class FormVersionQuery

java.lang.Object
com.avoka.tm.query.FormVersionQuery

public class FormVersionQuery extends Object

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:
22.10.4
See Also:
  • Constructor Details

  • Method Details

    • setId

      public FormVersionQuery setId(Long id)
      Set the form version id (PK) query parameter.
      Parameters:
      id - the form version id (PK) query parameter
      Returns:
      the formVersion query
    • setFormCode

      public FormVersionQuery setFormCode(String formCode)
      Set the form code parameter.
      Parameters:
      formCode - the form code
      Returns:
      the formVersion query
    • setVersionNumber

      public FormVersionQuery setVersionNumber(String versionNumber)
      Set the version number.
      Parameters:
      versionNumber - the version number
      Returns:
      the formVersion query
    • setIncludeAllStatus

      public FormVersionQuery setIncludeAllStatus()
      Set the includeAllStatus parameter. If it sets to true, query includes all form versions(Active, Offline, Inactive, NoRender).
      Returns:
      the formVersion query
    • setFetchLimit

      public FormVersionQuery setFetchLimit(int fetchLimit)
      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

      public FormVersionQuery addOrderByAsc(String orderProperty)
      Add the sort order by ascending to the query.
      Parameters:
      orderProperty - the property to sort by (required)
      Returns:
      the formVersion query
    • addOrderByDesc

      public FormVersionQuery addOrderByDesc(String orderProperty)
      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

      public String listJson()
      Execute the query and return a formVersion JSON array list.
      Returns:
      execute the query and return a formVersion JSON array list.
    • firstValue

      public FormVersion 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

      public List<FormVersion> 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.