|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.QueryTranslator
org.apache.cayenne.access.trans.QueryAssembler
org.apache.cayenne.access.trans.SelectTranslator
public class SelectTranslator
A builder of JDBC PreparedStatements based on Cayenne SelectQueries. Translates SelectQuery to parameterized SQL string and wraps it in a PreparedStatement. SelectTranslator is stateful and thread-unsafe.
Field Summary | |
---|---|
protected static int[] |
UNSUPPORTED_DISTINCT_TYPES
|
Fields inherited from class org.apache.cayenne.access.trans.QueryAssembler |
---|
attributes, values |
Fields inherited from class org.apache.cayenne.access.QueryTranslator |
---|
adapter, connection, engine, entityResolver, query |
Constructor Summary | |
---|---|
SelectTranslator()
|
Method Summary | |
---|---|
java.lang.String |
aliasForTable(DbEntity ent)
Overrides superclass implementation. |
java.lang.String |
aliasForTable(DbEntity ent,
DbRelationship rel)
|
java.lang.String |
createSqlString()
Returns query translated to SQL. |
void |
dbRelationshipAdded(DbRelationship rel)
Stores a new relationship in an internal list. |
java.util.Map |
getAttributeOverrides()
Returns a map of ColumnDescriptors keyed by ObjAttribute for columns that may need to be reprocessed manually due to incompatible mappings along the inheritance hierarchy. |
protected java.util.List |
getColumns()
Deprecated. since 1.2 - contents of this list are now ColumnDescriptors, not DbAttributes. Anyway, use getResultColumns() instead to reduce confusion. |
ColumnDescriptor[] |
getResultColumns()
Returns a list of ColumnDescriptors for the query columns. |
boolean |
isSuppressingDistinct()
Returns true if SelectTranslator determined that a query requiring DISTINCT can't be run with DISTINCT keyword for internal reasons. |
protected static boolean |
isUnsupportedForDistinct(int type)
|
protected java.lang.String |
newAliasForTable(DbEntity ent)
Sets up and returns a new alias for a speciafied table. |
boolean |
supportsTableAliases()
Always returns true. |
Methods inherited from class org.apache.cayenne.access.trans.QueryAssembler |
---|
addToParamList, createStatement, initStatement |
Methods inherited from class org.apache.cayenne.access.QueryTranslator |
---|
createStatement, getAdapter, getCon, getConnection, getEngine, getEntityResolver, getQuery, getRootDbEntity, getRootEntity, getRootInheritanceTree, setAdapter, setCon, setConnection, setEngine, setEntityResolver, setQuery |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int[] UNSUPPORTED_DISTINCT_TYPES
Constructor Detail |
---|
public SelectTranslator()
Method Detail |
---|
protected static boolean isUnsupportedForDistinct(int type)
protected java.util.List getColumns()
public java.lang.String createSqlString() throws java.lang.Exception
createSqlString
in class QueryAssembler
java.lang.Exception
public ColumnDescriptor[] getResultColumns()
public java.util.Map getAttributeOverrides()
public boolean isSuppressingDistinct()
public void dbRelationshipAdded(DbRelationship rel)
dbRelationshipAdded
in class QueryAssembler
protected java.lang.String newAliasForTable(DbEntity ent)
public java.lang.String aliasForTable(DbEntity ent, DbRelationship rel)
aliasForTable
in class QueryAssembler
public java.lang.String aliasForTable(DbEntity ent)
aliasForTable
in class QueryAssembler
public boolean supportsTableAliases()
supportsTableAliases
in class QueryAssembler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |