java.lang.Object
org.objectstyle.cayenne.access.QueryTranslator
org.objectstyle.cayenne.access.trans.QueryAssembler
- Direct Known Subclasses:
- DeleteTranslator, InsertTranslator, SelectQueryAssembler, SelectTranslator, SqlModifyTranslator, SqlSelectTranslator, UpdateTranslator
- public abstract class QueryAssembler
- extends org.objectstyle.cayenne.access.QueryTranslator
Abstract superclass of Query translators.
| 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
values
protected java.util.List values
- PreparedStatement values.
attributes
protected java.util.List attributes
- PreparedStatement attributes matching entries in
values
list.
QueryAssembler
public QueryAssembler()
dbRelationshipAdded
public abstract void dbRelationshipAdded(org.objectstyle.cayenne.map.DbRelationship dbRel)
- Processes a join being added.
createSqlString
public abstract java.lang.String createSqlString()
throws java.lang.Exception
- 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.
aliasForTable
public java.lang.String aliasForTable(org.objectstyle.cayenne.map.DbEntity ent,
org.objectstyle.cayenne.map.DbRelationship rel)
aliasForTable
public abstract java.lang.String aliasForTable(org.objectstyle.cayenne.map.DbEntity dbEnt)
- 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.
supportsTableAliases
public boolean supportsTableAliases()
- Returns
true if table aliases are supported.
Default implementation returns false.
addToParamList
public void addToParamList(org.objectstyle.cayenne.map.DbAttribute dbAttr,
java.lang.Object anObject)
- Registers
anObject as a PreparedStatement paramter.
createStatement
public java.sql.PreparedStatement createStatement(org.apache.log4j.Level logLevel)
throws java.lang.Exception
- Translates internal query into PreparedStatement.
initStatement
protected void initStatement(java.sql.PreparedStatement stmt)
throws java.lang.Exception
- Initializes prepared statements with collected parameters.
Called internally from "createStatement". Cayenne users
shouldn't normally call it directly.