Package com.avoka.tm.query
Class SpaceQuery
java.lang.Object
com.avoka.tm.query.SpaceQuery
Provides a form space query class.
Examples
Please find the space query examples about list, get first and count below.
Space Query List Example
This Groovy example shows how to list spaces matching certain criteria ordered ascending by name (maximum number of 4 records).
 import com.avoka.tm.query.*
 import com.avoka.tm.vo.*
 List<Space> spaces = new SpaceQuery()
     .setFetchLimit(4)
     .addOrderByAsc("name")
     .listValues()
 // In JSON format
 String spacesJson = new SpaceQuery()
     .setFetchLimit(4)
     .addOrderByAsc("name")
     .listJson() 
 Space Query First Example
This Groovy example shows how to get first space matching certain criteria ordered descending by id.
 import com.avoka.tm.query.*
 import com.avoka.tm.vo.*
 Space space = new SpaceQuery()
     .setName(spaceName)
     .firstValue()
 // In JSON format
 String spaceJson = new SpaceQuery()
     .setName(spaceName)
     .firstJson()  
 Space Query Count Example
This Groovy example shows how to count all spaces matching certain criteria.
 import com.avoka.tm.query.*
 int spaceWithCtxPathCount = new SpaceQuery()
     .setContextPath(ctxPath)
     .count() - Since:
- 5.0.0
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.intcount()Execute a select count query and return the total number of records selected by the query.Execute the query and return the first space JSON value.Execute the query and return the first space value object for the query.listJson()Execute the query and return a space JSON array list.Execute the space query and return a list of Space value objects.setContextPath(String contextPath) Set the space context path parameter.setFetchLimit(int fetchLimit) Set the query fetch limit to limit the maximum number of records returned.Set the space id (PK) query parameter.Set the space name query parameter.
- 
Constructor Details- 
SpaceQuery
 
- 
- 
Method Details- 
setIdSet the space id (PK) query parameter.- Parameters:
- id- the space id (PK) query parameter
- Returns:
- the space query
 
- 
setNameSet the space name query parameter.- Parameters:
- name- the space name query parameter
- Returns:
- the space query
 
- 
setContextPathSet the space context path parameter.- Parameters:
- contextPath- the space content path parameter
- Returns:
- the space query
 
- 
setFetchLimitSet 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 space query
 
- 
addOrderByAscAdd the sort order by ascending to the query.- Parameters:
- orderProperty- the property to sort by (required)
- Returns:
- the space query
 
- 
addOrderByDescAdd the sort order by descending to the query.- Parameters:
- orderProperty- the property to sort by (required)
- Returns:
- the space query
 
- 
countpublic 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
 
- 
listValuesExecute the space query and return a list of Space value objects.- Returns:
- execute the space query and return a list of Space value objects
 
- 
listJsonExecute the query and return a space JSON array list.- Returns:
- execute the query and return a space JSON array list
 
- 
firstValueExecute the query and return the first space value object for the query.- Returns:
- execute the query and return the first space value object for the query
 
- 
firstJsonExecute the query and return the first space JSON value.- Returns:
- execute the query and return the first space JSON value
 
 
-