|
||||||||||
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
public abstract class QueryAssembler
Abstract superclass of Query translators.
Field Summary | |
---|---|
protected List |
attributes
PreparedStatement attributes matching entries in values list. |
protected List |
values
PreparedStatement values. |
Fields inherited from class org.apache.cayenne.access.QueryTranslator |
---|
adapter, connection, entityResolver, query |
Constructor Summary | |
---|---|
QueryAssembler()
|
Method Summary | |
---|---|
void |
addToParamList(DbAttribute dbAttr,
Object anObject)
Registers anObject as a PreparedStatement paramter. |
abstract String |
aliasForTable(DbEntity dbEnt)
Returns a name that can be used as column alias. |
String |
aliasForTable(DbEntity ent,
DbRelationship rel)
|
abstract String |
createSqlString()
Translates query into sql string. |
PreparedStatement |
createStatement()
Translates internal query into PreparedStatement. |
abstract void |
dbRelationshipAdded(DbRelationship dbRel)
Processes a join being added. |
protected void |
initStatement(PreparedStatement stmt)
Initializes prepared statements with collected parameters. |
boolean |
supportsTableAliases()
Returns true if table aliases are supported. |
Methods inherited from class org.apache.cayenne.access.QueryTranslator |
---|
getAdapter, getConnection, getEntityResolver, getQuery, getRootDbEntity, getRootEntity, getRootInheritanceTree, setAdapter, setConnection, setEntityResolver, setQuery |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List values
protected List attributes
values
list.
Constructor Detail |
---|
public QueryAssembler()
Method Detail |
---|
public abstract void dbRelationshipAdded(DbRelationship dbRel)
public abstract String createSqlString() throws Exception
createStatement
. Usually there is no need
to invoke it explicitly.
Exception
public String aliasForTable(DbEntity ent, DbRelationship rel)
public abstract String aliasForTable(DbEntity dbEnt)
public boolean supportsTableAliases()
true
if table aliases are supported. Default implementation
returns false.
public void addToParamList(DbAttribute dbAttr, Object anObject)
anObject
as a PreparedStatement paramter.
anObject
- object that represents a value of DbAttributedbAttr
- DbAttribute being processed.public PreparedStatement createStatement() throws Exception
createStatement
in class QueryTranslator
Exception
protected void initStatement(PreparedStatement stmt) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |