public abstract class QueryAssembler extends Object
Modifier and Type | Field and Description |
---|---|
protected DbAdapter |
adapter |
protected List<DbAttribute> |
attributes
PreparedStatement attributes matching entries in
values list. |
protected Connection |
connection |
protected EntityResolver |
entityResolver |
protected JdbcEventLogger |
logger |
protected int |
parameterIndex
The index parameter will be inserted at in parameter list
|
protected Query |
query |
protected QueryMetadata |
queryMetadata |
protected List<Object> |
values
Holds PreparedStatement values.
|
Constructor and Description |
---|
QueryAssembler() |
Modifier and Type | Method and Description |
---|---|
void |
addToParamList(DbAttribute dbAttr,
Object anObject)
Registers
anObject as 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() |
JdbcEventLogger |
getJdbcEventLogger() |
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() |
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 |
setJdbcEventLogger(JdbcEventLogger logger) |
void |
setQuery(Query query) |
boolean |
supportsTableAliases()
Returns
true if table aliases are supported. |
protected Query query
protected QueryMetadata queryMetadata
protected Connection connection
protected DbAdapter adapter
protected EntityResolver entityResolver
protected JdbcEventLogger logger
protected List<DbAttribute> attributes
values
list.protected int parameterIndex
protected Map<String,String> getPathAliases()
public EntityResolver getEntityResolver()
public DbAdapter getAdapter()
public Query getQuery()
public QueryMetadata getQueryMetadata()
public void setQuery(Query query)
public void setConnection(Connection connection)
public void setAdapter(DbAdapter adapter)
public void setJdbcEventLogger(JdbcEventLogger logger)
public JdbcEventLogger getJdbcEventLogger()
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.Exception
public 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
Copyright © 2001–2018 Apache Cayenne. All rights reserved.