Class WebQuery
java.lang.Object
com.peterphi.std.guice.restclient.jaxb.webquery.WebQuery
- All Implemented Interfaces:
ConstraintContainer<WebQuery>
Describes a database query to be executed
-
Field Summary
Modifier and TypeFieldDescriptionComma-separated list of relations to fetch from the database as part of the queryWhat relationships to expand (by default, all relationships are expanded)What to fetch: should be "entity" or "id".static final int
Special limit value used to request the returning of 0 data rows (will still return count if requested)boolean
An optional name for the query, to allow server-side optimisation/hinting -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(WQConstraintLine line) computeSize
(boolean computeSize) Overwrite any fields in this WebQuery using the query defined in the provided mapdecode
(javax.ws.rs.core.UriInfo qs) Overwrite any fields in this WebQuery using the query defined in the Query String of the provided UriInfodecode
(javax.ws.rs.core.UriInfo qs, WebQueryDecodePlugin parserPlugin) encode()
Encode this query to the equivalent (where possible) URI web querygetFetch()
int
getLimit()
int
boolean
boolean
boolean
isLogSQL()
limit
(int limit) logPerformance
(boolean enabled) logSQL
(boolean enabled) offset
(int offset) static WebQuery
toQueryFragment
(boolean includeSelectAndExpand) toString()
-
Field Details
-
LIMIT_RETURN_ZERO
public static final int LIMIT_RETURN_ZEROSpecial limit value used to request the returning of 0 data rows (will still return count if requested)- See Also:
-
name
An optional name for the query, to allow server-side optimisation/hinting -
fetch
What to fetch: should be "entity" or "id". -
dbfetch
Comma-separated list of relations to fetch from the database as part of the query -
expand
What relationships to expand (by default, all relationships are expanded) -
logSQL
public boolean logSQL -
logPerformance
-
constraints
-
orderings
-
-
Constructor Details
-
WebQuery
public WebQuery()
-
-
Method Details
-
expand
-
getOffset
public int getOffset() -
getLimit
public int getLimit() -
getFetch
-
getDBFetch
-
getExpand
-
isComputeSize
public boolean isComputeSize() -
isLogSQL
public boolean isLogSQL() -
isLogPerformance
public boolean isLogPerformance() -
subclass
-
fetch
-
offset
-
limit
-
computeSize
-
order
-
orderAsc
-
orderDesc
-
logSQL
-
logPerformance
-
dbfetch
-
name
-
add
- Specified by:
add
in interfaceConstraintContainer<WebQuery>
-
decode
Overwrite any fields in this WebQuery using the query defined in the Query String of the provided UriInfo- Parameters:
qs
- the UriInfo to extract the QueryParameters from- Returns:
- this WebQuery for chaining
-
decode
-
decode
-
decode
Overwrite any fields in this WebQuery using the query defined in the provided map- Parameters:
map
- a map of fields (or control fields) to encoded constraints- Returns:
- this WebQuery for chaining
-
decode
- Parameters:
textQuery
-
-
encode
Encode this query to the equivalent (where possible) URI web query- Returns:
-
toString
-
toQueryFragment
-
toQueryFragment
-
parse
-