Package com.avoka.tm.query
Class GroupQuery
- java.lang.Object
-
- com.avoka.tm.query.GroupQuery
-
public class GroupQuery extends java.lang.Object
Provides a group query class.
Examples
Please find the query query examples about list, get first and count below.
Group Query List Example
This Groovy example shows how to list group matching certain criteria ordered ascending by name (maximum number of 4 records).
import com.avoka.tm.query.* import com.avoka.tm.vo.* List<Group> groups = new GroupQuery() .setFetchLimit(4) .addOrderByAsc("name") .listValues() // In JSON format String groupsJson = new GroupQuery() .setFetchLimit(4) .addOrderByAsc("name") .listJson()
Group Query First Example
This Groovy example shows how to get first group matching certain criteria ordered descending by id.
import com.avoka.tm.query.* import com.avoka.tm.vo.* Group group = new GroupQuery() .setName(groupName) .firstValue() // In JSON format String groupJson = new GroupQuery() .setName(groupName) .firstJson()
- Since:
- 18.11.0
- See Also:
Group
-
-
Constructor Summary
Constructors Constructor Description GroupQuery()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
count()
Execute a select count query and return the total number of records selected by the query.java.lang.String
firstJson()
Execute the query and return the first group JSON value.Group
firstValue()
Execute the query and return the first group value object for the query.java.lang.String
listJson()
Execute the query and return a group JSON array list.java.util.List<Group>
listValues()
Execute the group query and return a list of Group value objects.GroupQuery
setFetchLimit(int fetchLimit)
Set the query fetch limit to limit the maximum number of records returned.GroupQuery
setId(java.lang.Long id)
Set the group id (PK) query parameter.GroupQuery
setName(java.lang.String name)
Set the group name query parameter.GroupQuery
setType(java.lang.String type)
Set the group type parameter.
-
-
-
Method Detail
-
setId
public GroupQuery setId(java.lang.Long id)
Set the group id (PK) query parameter.- Parameters:
id
- the group id (PK) query parameter- Returns:
- the group query
-
setName
public GroupQuery setName(java.lang.String name)
Set the group name query parameter.- Parameters:
name
- the group name query parameter- Returns:
- the group query
-
setType
public GroupQuery setType(java.lang.String type)
Set the group type parameter.- Parameters:
type
- the group type parameter- Returns:
- the group query
-
setFetchLimit
public GroupQuery 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 group 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 java.util.List<Group> listValues()
Execute the group query and return a list of Group value objects.- Returns:
- execute the group query and return a list of Group value objects
-
listJson
public java.lang.String listJson()
Execute the query and return a group JSON array list.- Returns:
- execute the query and return a group JSON array list
-
firstValue
public Group firstValue()
Execute the query and return the first group value object for the query.- Returns:
- execute the query and return the first group value object for the query
-
firstJson
public java.lang.String firstJson()
Execute the query and return the first group JSON value.- Returns:
- execute the query and return the first group JSON value
-
-