Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.3.5 generated on August 31 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.query
Interface KodoQuery

All Superinterfaces:
  Query, Serializable

All Known Subinterfaces:
  KodoQuerySPI

public interface KodoQuery
extends Query

Extension of the `Query` interface that adds some Kodo-specific methods.

Since:
  3.0

Field Summary
`static int` | `FLUSH_FALSE` Deprecated. Use `FetchConfiguration.QUERY_FLUSH_FALSE`
`static int` | `FLUSH_TRUE` Deprecated. Use `FetchConfiguration.QUERY_FLUSH_TRUE`
`static int` | `FLUSH_WITH_CONNECTION` Deprecated. Use `FetchConfiguration.QUERY_FLUSH_WITH_CONNECTION`

Method Summary
`void` | `addAggregateListener(AggregateListener listener)` Register an aggregate listener for the query.
`void` | `addExtension(String key, Object value)` JDO 2.0 Preview.
`void` | `addFilterListener(FilterListener listener)` Register a filter listener for the query.
`Collection` | `getAggregateListeners()` Return the aggregate listeners added to this query, or empty collection if none.
`Class` | `getCandidateClass()` Return the class of the objects that this query will return, or `null` if this information is not available / not relevant.
`Collection` | `getCandidateCollection()` Return the candidate collection, or `null` if an extent was specified instead of a collection.
`KodoExtent` | `getCandidateExtent()` Return the candidate extent, or `null` if a collection was specified instead of an extent.
`String[]` | `getDataStoreActions(Map params)` Returns a description of the commands that will be sent to the datastore in order to execute this query.
`long` | `getEndIndex()` Return the 0-based exclusive end index for the returned results, or `Long.MAX_VALUE` for no limit.
`FetchConfiguration` | `getFetchConfiguration()` Return the (mutable) fetch configuration for this query.
`String` | `getFilter()` Return the filter that this query has been configured with.
`Collection` | `getFilterListeners()` Return the filter listeners added to this query, or empty collection if none.
`String` | `getGrouping()` Return the grouping expression for this query.
`String` | `getImports()` Return the import declaration.
`String` | `getLanguage()` Return the language of this query.
`String` | `getOrdering()` Return the ordering expression that this query was configured with.
`String` | `getParameters()` Return the declared parameters.
`String` | `getQueryString()` Return a single-string representation of the query, if applicable.
`String` | `getResult()` Return the result expression set for this query.
`Class` | `getResultClass()` Returns the result class that has been set through `setResultClass(java.lang.Class)`, or null if none.
`long` | `getStartIndex()` Return the 0-based start index for the returned results.
`String` | `getVariables()` Return the declared variables.
`boolean` | `hasSubclasses()` Whether query results will include subclasses of the candidate class.
`boolean` | `isUnique()` The unique flag.
`void` | `removeAggregateListener(AggregateListener listener)` Remove an aggregate listener from the query.
`void` | `removeFilterListener(FilterListener listener)` Remove a filter listener from the query.
`void` | `setExtensions(Map extensions)` JDO 2.0 Preview.
`void` | `setGrouping(String group)` JDO 2.0 Preview.
`void` | `setRange(long start, long end)` JDO 2.0 Preview.
`void` | `setResult(String result)` JDO 2.0 Preview.
`void` | `setResultClass(Class cls)` JDO 2.0 Preview.
`void` | `setUnique(boolean unique)` JDO 2.0 Preview.

Methods inherited from interface javax.jdo.Query
`close, closeAll, compile, declareImports, declareParameters, declareVariables, execute, execute, execute, execute, executeWithArray, executeWithMap, getIgnoreCache, getPersistenceManager, setCandidates, setCandidates, setClass, setFilter, setIgnoreCache, setOrdering`

Field Detail

### FLUSH_TRUE

    public static final int FLUSH_TRUE

  Deprecated. Use `FetchConfiguration.QUERY_FLUSH_TRUE`

### FLUSH_FALSE

    public static final int FLUSH_FALSE

  Deprecated. Use `FetchConfiguration.QUERY_FLUSH_FALSE`

### FLUSH_WITH_CONNECTION

    public static final int FLUSH_WITH_CONNECTION

  Deprecated. Use `FetchConfiguration.QUERY_FLUSH_WITH_CONNECTION`

Method Detail

### getLanguage

    public String getLanguage()

  Return the language of this query.
  Since:
    3.1

### getFetchConfiguration

    public FetchConfiguration getFetchConfiguration()

  Return the (mutable) fetch configuration for this query.

### getFilterListeners

    public Collection getFilterListeners()

  Return the filter listeners added to this query, or empty collection if none.

### addFilterListener

    public void addFilterListener(FilterListener listener)

  Register a filter listener for the query.

### removeFilterListener

    public void removeFilterListener(FilterListener listener)

  Remove a filter listener from the query.

### getAggregateListeners

    public Collection getAggregateListeners()

  Return the aggregate listeners added to this query, or empty collection if none.

### addAggregateListener

    public void addAggregateListener(AggregateListener listener)

  Register an aggregate listener for the query.

### removeAggregateListener

    public void removeAggregateListener(AggregateListener listener)

  Remove an aggregate listener from the query.

### getDataStoreActions

    public String[] getDataStoreActions(Map params)

  Returns a description of the commands that will be sent to the datastore in order to execute this query. This will typically be in the native query language of the database (e.g., SQL).
  Parameters:
    `params` - the named parameter map for the query invocation
  Since:
    3.2

### getCandidateExtent

    public KodoExtent getCandidateExtent()

  Return the candidate extent, or `null` if a collection was specified instead of an extent.

### getCandidateCollection

    public Collection getCandidateCollection()

  Return the candidate collection, or `null` if an extent was specified instead of a collection.

### getCandidateClass

    public Class getCandidateClass()

  Return the class of the objects that this query will return, or `null` if this information is not available / not relevant.

### hasSubclasses

    public boolean hasSubclasses()

  Whether query results will include subclasses of the candidate class.

### getQueryString

    public String getQueryString()

  Return a single-string representation of the query, if applicable.

### getFilter

    public String getFilter()

  Return the filter that this query has been configured with.

### getOrdering

    public String getOrdering()

  Return the ordering expression that this query was configured with.

### getImports

    public String getImports()

  Return the import declaration.

### getParameters

    public String getParameters()

  Return the declared parameters.

### getVariables

    public String getVariables()

  Return the declared variables.

### setUnique

    public void setUnique(boolean unique)

  JDO 2.0 Preview. Specify that the query will return only 1 result, rather than a collection. The execute method will return null if the query result size is 0.
  Since:
    3.0

### isUnique

    public boolean isUnique()

  The unique flag.

### setResult

    public void setResult(String result)

  JDO 2.0 Preview. Configures what type of data this query should return. If this is unset or set to `null`, this query will return a list of the query's candidate class. Otherwise, this query will return aggregate function results and / or individual field values (projections).
  Parameters:
    `result` - optional "distinct" keyword, followed by a comma-delimited list of fields, functions on fields, or aggregate functions to return from this query
  Since:
    3.0

### getResult

    public String getResult()

  Return the result expression set for this query.

### setResultClass

    public void setResultClass(Class cls)

  JDO 2.0 Preview. Specify the type of object in which the result of invoking `Query.execute()` or one of its siblings. The behavior of this method depends the nature of the query being executed. In particular, if used in conjunction with `setResult(java.lang.String)`, the argument to this method should be `Object[].class`, a class with bean-like setters for each of the items listed in the result specification, or a class with a method called `put` with two `Object` arguments.
  Since:
    3.0

### getResultClass

    public Class getResultClass()

  Returns the result class that has been set through `setResultClass(java.lang.Class)`, or null if none.

### setGrouping

    public void setGrouping(String group)

  JDO 2.0 Preview. Set the grouping expressions, optionally including a "having" clause. When grouping is specified, each result expression must either be an expression contained in the grouping, or an aggregate evaluated once per group.
  Parameters:
    `group` - a comma-delimited list of expressions, optionally followed by the "having" keyword and a boolean expression
  Since:
    3.2

### getGrouping

    public String getGrouping()

  Return the grouping expression for this query.

### setRange

    public void setRange(long start,
                         long end)

  JDO 2.0 Preview. Set the range of results to return.
  Parameters:
    `start` - 0-based inclusive start index
    `end` - 0-based exclusive end index, or `Long.MAX_VALUE` for no limit
  Since:
    3.2

### getStartIndex

    public long getStartIndex()

  Return the 0-based start index for the returned results.

### getEndIndex

    public long getEndIndex()

  Return the 0-based exclusive end index for the returned results, or `Long.MAX_VALUE` for no limit.

### addExtension

    public void addExtension(String key,
                             Object value)

  JDO 2.0 Preview. Add an extension this query. Kodo recognizes the following extension keys; others will be ignored:
  - `kodo.FilterListener`: Register a filter listener for this query; analogous to invoking `addFilterListener(kodo.query.FilterListener)`.
  - `kodo.AggregateListener`: Register an aggregate listener for this query; analogous to invoking `addAggregateListener(kodo.query.AggregateListener)`.
  - `kodo.FetchPlan.<property>`: Set the bean `property` of this query's fetch plan to the supplied value.
  Since:
    3.2

### setExtensions

    public void setExtensions(Map extensions)

  JDO 2.0 Preview. Set multiple extensions, or use null to clear extensions. This includes removing added listeners and returning fetch configuration properties to their previous values.
  Since:
    3.2
  See Also:
    `addExtension(java.lang.String, java.lang.Object)`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.3.5 generated on August 31 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.