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

## org.apache.cayenne.access
Class QueryTranslator

    java.lang.Object
      org.apache.cayenne.access.QueryTranslator

Direct Known Subclasses:
  ProcedureTranslator, QueryAssembler

    public abstract class QueryTranslator

extends Object

Defines API for translation Cayenne queries to JDBC PreparedStatements.

For more information see Cayenne User Guide.

Author:
  Andrus Adamchik

Field Summary
`protected DbAdapter` | `adapter` Adapter helping to do SQL literal conversions, etc.
`protected Connection` | `connection` JDBC database connection needed to create PreparedStatement.
`protected EntityResolver` | `entityResolver` Provides access to Cayenne mapping info.
`protected Query` | `query` Query being translated.

Constructor Summary
`QueryTranslator()`

Method Summary
`abstract PreparedStatement` | `createStatement()` Creates PreparedStatement.
`DbAdapter` | `getAdapter()`
`Connection` | `getConnection()` Returns Connection object used by this translator.
`EntityResolver` | `getEntityResolver()`
`Query` | `getQuery()` Returns query object being processed.
`DbEntity` | `getRootDbEntity()`
`ObjEntity` | `getRootEntity()`
`EntityInheritanceTree` | `getRootInheritanceTree()` Returns an EntityInheritanceTree for the root entity.
`void` | `setAdapter(DbAdapter adapter)`
`void` | `setConnection(Connection connection)`
`void` | `setEntityResolver(EntityResolver entityResolver)`
`void` | `setQuery(Query query)`

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

Field Detail

### query

    protected Query query

  Query being translated.

### connection

    protected Connection connection

  JDBC database connection needed to create PreparedStatement. Prior to 1.2 this property was called "con".

### adapter

    protected DbAdapter adapter

  Adapter helping to do SQL literal conversions, etc.

### entityResolver

    protected EntityResolver entityResolver

  Provides access to Cayenne mapping info.

  Since:
    1.2

Constructor Detail

### QueryTranslator

    public QueryTranslator()

Method Detail

### createStatement

    public abstract PreparedStatement createStatement()
                                               throws Exception

  Creates PreparedStatement. `logLevel` parameter is supplied to allow control of logging of produced SQL.

  Throws:
    `Exception`

### getQuery

    public Query getQuery()

  Returns query object being processed.

### setQuery

    public void setQuery(Query query)

### getConnection

    public Connection getConnection()

  Returns Connection object used by this translator.

  Since:
    1.2

### setConnection

    public void setConnection(Connection connection)

  Since:
    1.2

### getAdapter

    public DbAdapter getAdapter()

### setAdapter

    public void setAdapter(DbAdapter adapter)

### getRootInheritanceTree

    public EntityInheritanceTree getRootInheritanceTree()

  Returns an EntityInheritanceTree for the root entity.

  Since:
    1.1

### getRootEntity

    public ObjEntity getRootEntity()

### getRootDbEntity

    public DbEntity getRootDbEntity()

### getEntityResolver

    public EntityResolver getEntityResolver()

  Since:
    1.2

### setEntityResolver

    public void setEntityResolver(EntityResolver entityResolver)

  Since:
    1.2

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

Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.