Class SvcDefQuery


  • public class SvcDefQuery
    extends Object

    Provides a service definition value object query class.

    Examples

    Please find the service definition query examples.

    Service Definition List Example

    This Groovy example shows how to list service definitions matching.

     import com.avoka.tm.query.*
     import com.avoka.tm.vo.*
    
     List<SvcDef> svcDefs = new SvcDefQuery()
          .setType("Dynamic Data")
          .withCurrentVersion()
          .listValues()
    
     // In JSON format
     String svcDefListJson = new SvcDefQuery()
          .setName("myServiceDefName")
          .listJson() 
    Since:
    5.1.0
    See Also:
    SvcDef
    • Method Detail

      • setId

        public SvcDefQuery setId​(Number id)
        Set the service definition id (PK) query parameter.
        Parameters:
        id - the service definition id (PK) query parameter
        Returns:
        the service definition query
      • setVersionNumber

        @Deprecated
        public SvcDefQuery setVersionNumber​(int versionNumber)
        Deprecated.
        Set the service definition version number parameter.
        Parameters:
        versionNumber - the service definition version number parameter
        Returns:
        the service definition query
      • setVersion

        public SvcDefQuery setVersion​(String version)
        Set the service definition version parameter.
        Parameters:
        version - the service definition version number parameter
        Returns:
        the service definition query
        Since:
        17.10.0
      • setName

        public SvcDefQuery setName​(String name)
        Set the service definition name parameter.
        Parameters:
        name - the service definition name parameter
        Returns:
        the service definition query
      • setClientCode

        public SvcDefQuery setClientCode​(String clientCode)
        Set the service definition client code parameter.
        Parameters:
        clientCode - the service definition client code parameter
        Returns:
        the service definition query
      • setType

        public SvcDefQuery setType​(String type)
        Set the service definition type parameter.
        Parameters:
        type - the service definition type parameter
        Returns:
        the service definition query
      • setCreatedBy

        public SvcDefQuery setCreatedBy​(String createdBy)
        Set the service definition created by parameter.
        Parameters:
        createdBy - the service definition created by parameter
        Returns:
        the service definition query
      • setLastModifiedBy

        public SvcDefQuery setLastModifiedBy​(String lastModifiedBy)
        Set the service definition last modified by parameter.
        Parameters:
        lastModifiedBy - the service definition created by parameter
        Returns:
        the service definition query
      • withCurrentVersion

        public SvcDefQuery withCurrentVersion()
        Set the query to return the service definition of current version.
        Returns:
        the service definition query
      • addOrderByAsc

        public SvcDefQuery addOrderByAsc​(String orderProperty)
        Add the sort order by ascending to the query.
        Parameters:
        orderProperty - the property to sort by (required)
        Returns:
        the service definition query
      • addOrderByDesc

        public SvcDefQuery addOrderByDesc​(String orderProperty)
        Add the sort order by descending to the query.
        Parameters:
        orderProperty - the property to sort by (required)
        Returns:
        the service definition query
      • setFetchLimit

        public SvcDefQuery 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 service definition 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

        public List<SvcDef> listValues()
        Execute the service definition query and return a list of SvcDef value objects.
        Returns:
        execute the service definition query and return a list of SvcDef value objects
      • listJson

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

        public SvcDef firstValue()
        Execute the query and return the first service definition value object for the query.
        Returns:
        execute the query and return the first service definition value object for the query
      • firstJson

        public String firstJson()
        Execute the query and return the first service definition JSON value.
        Returns:
        execute the query and return the first service definition JSON value