java.lang.Object
org.objectstyle.cayenne.access.QueryTranslator
org.objectstyle.cayenne.access.trans.QueryAssembler
org.objectstyle.cayenne.access.trans.SqlSelectTranslator
- All Implemented Interfaces:
- SelectQueryTranslator
- public class SqlSelectTranslator
- extends QueryAssembler
- implements SelectQueryTranslator
Class works as a translator of raw SELECT queries to JDBC statements.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logObj
private static org.apache.log4j.Logger logObj
SqlSelectTranslator
public SqlSelectTranslator()
appendResultTypesFromMetadata
public static void appendResultTypesFromMetadata(java.sql.ResultSet rs,
org.objectstyle.cayenne.access.util.ResultDescriptor desc)
- Initializes the types of columns in ResultDescriptor from the ResultSet metadata.
appendSnapshotLabelsFromMetadata
public static void appendSnapshotLabelsFromMetadata(java.sql.ResultSet rs,
org.objectstyle.cayenne.access.util.ResultDescriptor descriptor)
- Initializes the names of columns in ResultDescriptor from the ResultSet metadata.
aliasForTable
public java.lang.String aliasForTable(org.objectstyle.cayenne.map.DbEntity dbEnt)
- Description copied from class:
QueryAssembler
- Returns a name that can be used as column alias.
This can be one of the following:
- an alias for this table, if it uses aliases
- a fully qualified table name, if not.
CayenneRuntimeException is thrown if a table alias
can not be created.
- Specified by:
aliasForTable in class QueryAssembler
createSqlString
public java.lang.String createSqlString()
throws java.lang.Exception
- Description copied from class:
QueryAssembler
- Translates query into sql string. This is a workhorse
method of QueryAssembler. It is called internally from
createStatement. Usually there is no need
to invoke it explicitly.
- Specified by:
createSqlString in class QueryAssembler
dbRelationshipAdded
public void dbRelationshipAdded(org.objectstyle.cayenne.map.DbRelationship dbRel)
- Description copied from class:
QueryAssembler
- Processes a join being added.
- Specified by:
dbRelationshipAdded in class QueryAssembler
getRawQuery
private org.objectstyle.cayenne.query.SqlSelectQuery getRawQuery()
getResultDescriptor
public org.objectstyle.cayenne.access.util.ResultDescriptor getResultDescriptor(java.sql.ResultSet rs)
- Description copied from interface:
SelectQueryTranslator
- Returns a descriptor that contains information needed for the ResultSet processing.
- Specified by:
getResultDescriptor in interface SelectQueryTranslator
supportsTableAliases
public boolean supportsTableAliases()
- Description copied from class:
QueryAssembler
- Returns
true if table aliases are supported.
Default implementation returns false.
- Overrides:
supportsTableAliases in class QueryAssembler