## org.eclipse.emf.cdo.view
Interface CDOQuery

All Superinterfaces:
  CDOQueryInfo

    public interface CDOQuery

extends CDOQueryInfo

TODO Simon: JavaDoc

Since:
  2.0

Field Summary

Fields inherited from interface org.eclipse.emf.cdo.common.CDOQueryInfo
`UNLIMITED_RESULTS`

Method Summary

`

`<T> java.util.List<T>`

`

`getResult(java.lang.Class<T> classObject)`
Sends this query to the server and returns a typed `list` containing the query result.

`

`<T> org.eclipse.net4j.util.collection.CloseableIterator<T>`

`

`getResultAsync(java.lang.Class<T> classObject)`
Sends this query to the server and returns a typed `iterator` over the query result.

`CDOView` `getView()` Returns the `view` this query was created by and is associated with.
`CDOQuery` `setMaxResults(int maxResults)` Sets the maximum number of results to retrieve from the server.
`CDOQuery` `setParameter(java.lang.String name, java.lang.Object value)` Binds an argument value to a named parameter.

Methods inherited from interface org.eclipse.emf.cdo.common.CDOQueryInfo
`getMaxResults, getParameters, getQueryLanguage, getQueryString`

Method Detail

### getView

    CDOView getView()

  Returns the `view` this query was created by and is associated with.

  Returns:
    Never `null`.

### getResultAsync

    <T> org.eclipse.net4j.util.collection.CloseableIterator<T> getResultAsync(java.lang.Class<T> classObject)

  Sends this query to the server and returns a typed `iterator` over the query result.

  As opposed to the `getResult(Class)` method, this method asynchronously communicates with the server. In other words, the returned iterator can be used immediately, even if the server is still about to send pending result elements.

### getResult

    <T> java.util.List<T> getResult(java.lang.Class<T> classObject)

  Sends this query to the server and returns a typed `list` containing the query result.

  As opposed to the `getResultAsync(Class)` method, this method synchronously communicates with the server. In other words, the result list is only returned after all result elements have been received by the client.

### setMaxResults

    CDOQuery setMaxResults(int maxResults)

  Sets the maximum number of results to retrieve from the server.

  Parameters:
    `maxResults` - the maximum number of results to retrieve or `CDOQueryInfo.UNLIMITED_RESULTS` for no limitation.
  Returns:
    the same query instance.

### setParameter

    CDOQuery setParameter(java.lang.String name,
                          java.lang.Object value)

  Binds an argument value to a named parameter.

  Parameters:
    `name` - the parameter name
    `value` - the value to bind
  Returns:
    the same query instance
  Throws:
    `java.lang.IllegalArgumentException` - if the parameter name does not correspond to a parameter in the query string or if the argument value is of incorrect type

Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others. All Rights Reserved.