Package com.avoka.tm.query
Class GroupQuery
java.lang.Object
com.avoka.tm.query.GroupQuery
Provides a group query class.
Examples
Please find the Group 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:
-
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 group JSON value.Execute the query and return the first group value object for the query.listJson()
Execute the query and return a group JSON array list.Execute the group query and return a list of Group value objects.setFetchLimit
(int fetchLimit) Set the query fetch limit to limit the maximum number of records returned.Set the group id (PK) query parameter.Set the group name query parameter.Set the group type parameter.
-
Constructor Details
-
GroupQuery
-
-
Method Details
-
setId
Set the group id (PK) query parameter.- Parameters:
id
- the group id (PK) query parameter- Returns:
- the group query
-
setName
Set the group name query parameter.- Parameters:
name
- the group name query parameter- Returns:
- the group query
-
setType
Set the group type parameter.- Parameters:
type
- the group type parameter- Returns:
- the group 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 group query
-
addOrderByAsc
Add the sort order by ascending to the query.- Parameters:
orderProperty
- the property to sort by (required)- Returns:
- the group query
-
addOrderByDesc
Add the sort order by descending to the query.- Parameters:
orderProperty
- the property to sort by (required)- 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
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
Execute the query and return a group JSON array list.- Returns:
- execute the query and return a group JSON array list
-
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
Execute the query and return the first group JSON value.- Returns:
- execute the query and return the first group JSON value
-