| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.access.trans.QueryAssembler
public abstract class QueryAssembler
Abstract superclass of Query translators.
| Field Summary | |
|---|---|
| protected  DbAdapter | adapter | 
| protected  List<DbAttribute> | attributesPreparedStatement attributes matching entries in valueslist. | 
| protected  Connection | connection | 
| protected  EntityResolver | entityResolver | 
| protected  int | parameterIndexThe index parameter will be inserted at in parameter list | 
| protected  Query | query | 
| protected  QueryMetadata | queryMetadata | 
| protected  List<Object> | valuesHolds PreparedStatement values. | 
| Constructor Summary | |
|---|---|
| QueryAssembler() | |
| Method Summary | |
|---|---|
|  void | addToParamList(DbAttribute dbAttr,
               Object anObject)Registers anObjectas a PreparedStatement parameter. | 
| abstract  String | createSqlString()Translates query into sql string. | 
|  PreparedStatement | createStatement()Translates internal query into PreparedStatement. | 
| abstract  void | dbRelationshipAdded(DbRelationship relationship,
                    JoinType joinType,
                    String joinSplitAlias)Appends a join with given semantics to the query. | 
|  DbAdapter | getAdapter() | 
| abstract  String | getCurrentAlias()Returns an alias of the table which is currently at the top of the join stack. | 
|  EntityResolver | getEntityResolver() | 
| protected  Map<String,String> | getPathAliases()Returns aliases for the path splits defined in the query. | 
|  Query | getQuery()Returns query object being processed. | 
|  QueryMetadata | getQueryMetadata() | 
|  DbEntity | getRootDbEntity() | 
|  ObjEntity | getRootEntity() | 
|  EntityInheritanceTree | getRootInheritanceTree()Returns an EntityInheritanceTree for the root entity. | 
| protected  void | initStatement(PreparedStatement stmt)Initializes prepared statements with collected parameters. | 
| abstract  void | resetJoinStack()A callback invoked by a child qualifier or ordering processor allowing query assembler to reset its join stack. | 
|  void | setAdapter(DbAdapter adapter) | 
|  void | setConnection(Connection connection) | 
|  void | setEntityResolver(EntityResolver entityResolver) | 
|  void | setQuery(Query query) | 
|  boolean | supportsTableAliases()Returns trueif table aliases are supported. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected Query query
protected QueryMetadata queryMetadata
protected Connection connection
protected DbAdapter adapter
protected EntityResolver entityResolver
protected List<Object> values
protected List<DbAttribute> attributes
values list.
protected int parameterIndex
| Constructor Detail | 
|---|
public QueryAssembler()
| Method Detail | 
|---|
protected Map<String,String> getPathAliases()
public EntityResolver getEntityResolver()
public DbAdapter getAdapter()
public EntityInheritanceTree getRootInheritanceTree()
public Query getQuery()
public QueryMetadata getQueryMetadata()
public void setQuery(Query query)
public void setConnection(Connection connection)
public void setAdapter(DbAdapter adapter)
public void setEntityResolver(EntityResolver entityResolver)
public DbEntity getRootDbEntity()
public ObjEntity getRootEntity()
public abstract void resetJoinStack()
public abstract String getCurrentAlias()
public abstract void dbRelationshipAdded(DbRelationship relationship,
                                         JoinType joinType,
                                         String joinSplitAlias)
public abstract String createSqlString()
                                throws Exception
createStatement. Usually there is no need to
 invoke it explicitly.
Exceptionpublic boolean supportsTableAliases()
true if table aliases are supported. Default implementation
 returns false.
public void addToParamList(DbAttribute dbAttr,
                           Object anObject)
anObject as a PreparedStatement parameter.
anObject - object that represents a value of DbAttributedbAttr - DbAttribute being processed.
public PreparedStatement createStatement()
                                  throws Exception
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 | |||||||||