|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.ext.odata.Query<T>
T
- public class Query<T>
Specific query to a OData service, represents a particular HTTP request to a data service. This Java class is more or less equivalent to the WCF DataServiceQuery class.
Field Summary | |
---|---|
static int |
TYPE_COMPLEX_TYPE_OR_PROPERTY
Type of query: complex type or property. |
static int |
TYPE_COMPLEX_TYPE_PROPERTY
Type of query: property. |
static int |
TYPE_COMPLEX_TYPE_PROPERTY5
Type of query: property bis?? |
static int |
TYPE_ENTITY
Type of query: entity. |
static int |
TYPE_ENTITY_SET
Type of query: entity set. |
static int |
TYPE_LINKS
Type of query: links. |
static int |
TYPE_PROPERTY_VALUE
Type of query: property value. |
static int |
TYPE_UNKNOWN
Type of query: unknown. |
Constructor Summary | |
---|---|
Query(Service service,
String subpath,
Class<T> entityClass)
Constructor. |
Method Summary | |
---|---|
Query<T> |
addParameter(String name,
String value)
Creates a new Query |
Query<T> |
addParameters(Series<Parameter> params)
Creates a new Query |
protected String |
createTargetUri()
Returns the complete target URI reference for this query. |
void |
execute()
Executes the query. |
Query<T> |
expand(String path)
Creates a new Query |
Query<T> |
filter(String predicate)
Creates a new Query |
int |
getCount()
Returns the total number of elements in the entity set, or -1 if it is available. |
Service |
getService()
Returns the parent client service. |
String |
getSubpath()
Returns the path of the targeted entity relatively to the data service URI. |
Query<T> |
inlineCount(boolean inlineCount)
Creates a new Query |
Iterator<T> |
iterator()
Returns an iterator over a set of elements of type T. |
Query<T> |
orderBy(String criteria)
Creates a new Query |
Query<T> |
select(String select)
Creates a new Query |
void |
setQuery(String query)
Sets the query string of the request. |
Query<T> |
skip(int rowsCount)
Creates a new Query |
Query<T> |
skipToken(String token)
Creates a new Query |
Query<T> |
top(int rowsCount)
Creates a new Query |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_COMPLEX_TYPE_OR_PROPERTY
public static final int TYPE_COMPLEX_TYPE_PROPERTY
public static final int TYPE_COMPLEX_TYPE_PROPERTY5
public static final int TYPE_ENTITY
public static final int TYPE_ENTITY_SET
public static final int TYPE_LINKS
public static final int TYPE_PROPERTY_VALUE
public static final int TYPE_UNKNOWN
Constructor Detail |
---|
public Query(Service service, String subpath, Class<T> entityClass)
service
- The data service requested by the query.subpath
- The path of the targeted entity relatively to the data service
URI.entityClass
- The class of the target entity.Method Detail |
---|
public Query<T> addParameter(String name, String value)
name
- The string value that contains the name of the query string
option to add.value
- The value of the query string option.
public Query<T> addParameters(Series<Parameter> params)
params
- the set of name/value pairs to add to the query string
protected String createTargetUri()
public void execute() throws Exception
Exception
public Query<T> expand(String path)
path
- A string value that contains the requesting URI.
public Query<T> filter(String predicate)
predicate
- A string value that contains the predicate used to filter the
data.
public int getCount()
Exception
public Service getService()
public String getSubpath()
public Query<T> inlineCount(boolean inlineCount)
inlineCount
- True if the total number of entities in the entity set must be
returned.
public Iterator<T> iterator()
iterator
in interface Iterable<T>
public Query<T> orderBy(String criteria)
criteria
- A string value that contains the criteria used to order the
results.
public Query<T> select(String select)
select
- A string value that contains the requesting URI.
public void setQuery(String query)
query
- The query string of the request.public Query<T> skip(int rowsCount)
rowsCount
- A number of rows to skip.
public Query<T> skipToken(String token)
token
- A string value that contains the requesting URI.
public Query<T> top(int rowsCount)
rowsCount
- A number of rows used to limit the number of results.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |