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

## org.objectstyle.cayenne.access
Class QueryTranslator

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

Direct Known Subclasses:
  ProcedureTranslator, QueryAssembler

    public abstract class QueryTranslator

extends java.lang.Object

Defines API for translation Cayenne queries to JDBC PreparedStatements.

For more information see Cayenne User Guide.

Author:
  Andrei Adamchik

Field Summary
`protected DbAdapter` | `adapter` Adapter helping to do SQL literal conversions, etc.
`protected java.sql.Connection` | `connection` JDBC database connection needed to create PreparedStatement.
`protected QueryEngine` | `engine` Deprecated. Since 1.2 entityResolver property is used.
`protected EntityResolver` | `entityResolver` Provides access to Cayenne mapping info.
`protected Query` | `query` Query being translated.

Constructor Summary
`QueryTranslator()`

Method Summary
`abstract java.sql.PreparedStatement` | `createStatement()` Creates PreparedStatement.
`java.sql.PreparedStatement` | `createStatement(org.apache.log4j.Level logLevel)` Deprecated. since 1.2
`DbAdapter` | `getAdapter()`
`java.sql.Connection` | `getCon()` Deprecated. Since 1.2 use getConnection().
`java.sql.Connection` | `getConnection()` Returns Connection object used by this translator.
`QueryEngine` | `getEngine()` Deprecated. Since 1.2 use "getEntityResolver()"
`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` | `setCon(java.sql.Connection con)` Deprecated. since 1.2 use setConnection().
`void` | `setConnection(java.sql.Connection connection)`
`void` | `setEngine(QueryEngine engine)` Deprecated. Since 1.2 use "setEntityResolver()"
`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 java.sql.Connection connection

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

### engine

    protected QueryEngine engine

  Deprecated. Since 1.2 entityResolver property is used.
  Used mainly for name resolution.

### 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 java.sql.PreparedStatement createStatement()
                                                        throws java.lang.Exception

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

  Throws:
    `java.lang.Exception`

### createStatement

    public final java.sql.PreparedStatement createStatement(org.apache.log4j.Level logLevel)
                                                     throws java.lang.Exception

  Deprecated. since 1.2

  Throws:
    `java.lang.Exception`

### getQuery

    public Query getQuery()

  Returns query object being processed.

### setQuery

    public void setQuery(Query query)

### getConnection

    public java.sql.Connection getConnection()

  Returns Connection object used by this translator.

  Since:
    1.2

### setConnection

    public void setConnection(java.sql.Connection connection)

  Since:
    1.2

### getCon

    public java.sql.Connection getCon()

  Deprecated. Since 1.2 use getConnection().

### setCon

    public void setCon(java.sql.Connection con)

  Deprecated. since 1.2 use setConnection().

### getEngine

    public QueryEngine getEngine()

  Deprecated. Since 1.2 use "getEntityResolver()"

  Returns QueryEngine used by this translator.

### setEngine

    public void setEngine(QueryEngine engine)

  Deprecated. Since 1.2 use "setEntityResolver()"

### 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 | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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