public abstract class QueryAssemblerHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Appendable |
out |
protected QueryAssembler |
queryAssembler |
protected QuotingStrategy |
strategy |
| Constructor and Description |
|---|
QueryAssemblerHelper(QueryAssembler queryAssembler)
Creates QueryAssemblerHelper initializing with parent
QueryAssembler and
output buffer object. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendDbPath(Expression pathExp) |
protected void |
appendLikeEscapeCharacter(PatternMatchNode patternMatchNode)
Outputs the standard JDBC (database agnostic) expression for supplying the escape
character to the database server when supplying a LIKE clause.
|
protected void |
appendLiteral(Object val,
DbAttribute attr,
Expression parentExpression)
Appends SQL code to the query buffer to handle
val as a parameter to
the PreparedStatement being built. |
protected void |
appendLiteralDirect(Object val,
DbAttribute attr,
Expression parentExpression)
Appends SQL code to the query buffer to handle
val as a parameter to
the PreparedStatement being built. |
protected void |
appendObjPath(Expression pathExp)
Processes parts of the OBJ_PATH expression.
|
<T extends Appendable> |
appendPart(T out) |
protected abstract void |
doAppendPart() |
DbEntity |
getDbEntity() |
ObjEntity |
getObjEntity() |
protected DbAttribute |
paramsDbType(Expression e)
Returns database type of expression parameters or null if it can not be determined.
|
protected void |
processColumn(DbAttribute dbAttr) |
protected void |
processColumnWithQuoteSqlIdentifiers(DbAttribute dbAttr,
Expression pathExp) |
protected void |
processRelTermination(DbRelationship rel,
JoinType joinType,
String joinSplitAlias)
Handles case when a DB_NAME expression ends with relationship.
|
protected void |
processRelTermination(ObjRelationship rel,
JoinType joinType,
String joinSplitAlias)
Processes case when an OBJ_PATH expression ends with relationship.
|
protected QueryAssembler queryAssembler
protected Appendable out
protected QuotingStrategy strategy
public QueryAssemblerHelper(QueryAssembler queryAssembler)
QueryAssembler and
output buffer object.public ObjEntity getObjEntity()
public DbEntity getDbEntity()
public <T extends Appendable> T appendPart(T out) throws IOException
IOExceptionprotected abstract void doAppendPart()
throws IOException
IOExceptionprotected void appendLikeEscapeCharacter(PatternMatchNode patternMatchNode) throws IOException
If there is no escape character defined then this method will not output anything. An escape character of 0 will mean no escape character.
IOExceptionprotected void appendObjPath(Expression pathExp) throws IOException
IOExceptionprotected void appendDbPath(Expression pathExp) throws IOException
IOExceptionprotected void processColumn(DbAttribute dbAttr) throws IOException
IOExceptionprotected void processColumnWithQuoteSqlIdentifiers(DbAttribute dbAttr, Expression pathExp) throws IOException
IOExceptionprotected void appendLiteral(Object val, DbAttribute attr, Expression parentExpression) throws IOException
val as a parameter to
the PreparedStatement being built. Adds val into QueryAssembler
parameter list.
If val is null, "NULL" is appended to the query.
If val is a DataObject, its primary key value is used as a parameter.
Only objects with a single column primary key can be used.
val - object that should be appended as a literal to the query. Must be of one
of "standard JDBC" types, null or a DataObject.attr - DbAttribute that has information on what type of parameter is being
appended.IOExceptionprotected void appendLiteralDirect(Object val, DbAttribute attr, Expression parentExpression) throws IOException
val as a parameter to
the PreparedStatement being built. Adds val into QueryAssembler
parameter list.IOExceptionprotected DbAttribute paramsDbType(Expression e)
protected void processRelTermination(ObjRelationship rel, JoinType joinType, String joinSplitAlias) throws IOException
IOExceptionprotected void processRelTermination(DbRelationship rel, JoinType joinType, String joinSplitAlias) throws IOException
IOExceptionCopyright © 2001–2018 Apache Cayenne. All rights reserved.