Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.query
Class AbstractQuery

    java.lang.Object
      org.apache.cayenne.query.AbstractQuery

All Implemented Interfaces:
  java.io.Serializable, Query

Direct Known Subclasses:
  InsertQuery, ProcedureQuery, QualifiedQuery, SQLTemplate

    public abstract class AbstractQuery

extends java.lang.Object
implements Query

A common superclass of Cayenne queries.

Author:
  Andrus Adamchik
See Also:
  Serialized Form

Field Summary
`protected java.lang.String` | `name`
`protected java.lang.Object` | `root` The root object this query.

Constructor Summary
`AbstractQuery()`

Method Summary
`abstract SQLAction` | `createSQLAction(SQLActionVisitor visitor)` A callback method invoked by Cayenne during the final execution phase of the query run.
`QueryMetadata` | `getMetaData(EntityResolver resolver)` Returns default select parameters.
`java.lang.String` | `getName()` Returns a symbolic name of the query.
`java.lang.Object` | `getRoot()` Returns the root of this query.
`void` | `route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)` Implements default routing mechanism relying on the EntityResolver to find DataMap based on the query root.
`void` | `setName(java.lang.String name)` Sets a symbolic name of the query.
`void` | `setRoot(java.lang.Object value)` Sets the root of the query
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### root

    protected java.lang.Object root

  The root object this query. May be an entity name, Java class, ObjEntity or DbEntity, depending on the specific query and how it was constructed.

### name

    protected java.lang.String name

Constructor Detail

### AbstractQuery

    public AbstractQuery()

Method Detail

### getName

    public java.lang.String getName()

  Returns a symbolic name of the query.

  Specified by:
    `getName` in interface `Query`
  Since:
    1.1

### setName

    public void setName(java.lang.String name)

  Sets a symbolic name of the query.

  Specified by:
    `setName` in interface `Query`
  Since:
    1.1

### getMetaData

    public QueryMetadata getMetaData(EntityResolver resolver)

  Returns default select parameters.

  Specified by:
    `getMetaData` in interface `Query`
  Since:
    1.2

### getRoot

    public java.lang.Object getRoot()

  Returns the root of this query.

  Specified by:
    `getRoot` in interface `Query`

### setRoot

    public void setRoot(java.lang.Object value)

  Sets the root of the query

  Specified by:
    `setRoot` in interface `Query`
  Parameters:
    `value` - The new root
  Throws:
    `java.lang.IllegalArgumentException` - if value is not a String, ObjEntity, DbEntity, Procedure, DataMap, Class or null.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### createSQLAction

    public abstract SQLAction createSQLAction(SQLActionVisitor visitor)

  Description copied from interface: `Query`
  A callback method invoked by Cayenne during the final execution phase of the query run. A concrete query implementation is given a chance to decide how it should be handled. Implementors can pick an appropriate method of the SQLActionVisitor to handle itself, create a custom SQLAction of its own, or substitute itself with another query that should be used for SQLAction construction.

  Specified by:
    `createSQLAction` in interface `Query`
  Since:
    1.2

### route

    public void route(QueryRouter router,
                      EntityResolver resolver,
                      Query substitutedQuery)

  Implements default routing mechanism relying on the EntityResolver to find DataMap based on the query root. This mechanism should be sufficient for most queries that "know" their root.

  Specified by:
    `route` in interface `Query`
  Since:
    1.2

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 Apache.org All Rights Reserved.