|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.trans.QueryAssemblerHelper
public abstract class QueryAssemblerHelper
Translates parts of the query to SQL. Always works in the context of parent Translator.
Field Summary | |
---|---|
protected QueryAssembler |
queryAssembler
|
Constructor Summary | |
---|---|
QueryAssemblerHelper()
|
|
QueryAssemblerHelper(QueryAssembler queryAssembler)
Creates QueryAssemblerHelper. |
Method Summary | |
---|---|
protected void |
appendDbPath(StringBuffer buf,
Expression pathExp)
|
protected void |
appendLiteral(StringBuffer buf,
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(StringBuffer buf,
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(StringBuffer buf,
Expression pathExp)
Processes parts of the OBJ_PATH expression. |
abstract String |
doTranslation()
Translates the part of parent translator's query that is supported by this PartTranslator. |
DbEntity |
getDbEntity()
|
ObjEntity |
getObjEntity()
|
QueryAssembler |
getQueryAssembler()
Returns parent QueryAssembler that uses this helper. |
protected DbAttribute |
paramsDbType(Expression e)
Returns database type of expression parameters or null if it can not be determined. |
protected void |
processColumn(StringBuffer buf,
DbAttribute dbAttr)
|
protected void |
processColumn(StringBuffer buf,
DbAttribute dbAttr,
DbRelationship relationship)
|
protected void |
processColumn(StringBuffer buf,
Expression nameExp)
Appends column name of a column in a root entity. |
protected void |
processRelTermination(StringBuffer buf,
DbRelationship rel)
Handles case when a DB_NAME expression ends with relationship. |
protected void |
processRelTermination(StringBuffer buf,
ObjRelationship rel)
Processes case when an OBJ_PATH expression ends with relationship. |
void |
setQueryAssembler(QueryAssembler queryAssembler)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected QueryAssembler queryAssembler
Constructor Detail |
---|
public QueryAssemblerHelper()
public QueryAssemblerHelper(QueryAssembler queryAssembler)
Method Detail |
---|
public QueryAssembler getQueryAssembler()
public void setQueryAssembler(QueryAssembler queryAssembler)
public abstract String doTranslation()
public ObjEntity getObjEntity()
public DbEntity getDbEntity()
protected void appendObjPath(StringBuffer buf, Expression pathExp)
protected void appendDbPath(StringBuffer buf, Expression pathExp)
protected void processColumn(StringBuffer buf, Expression nameExp)
protected void processColumn(StringBuffer buf, DbAttribute dbAttr, DbRelationship relationship)
protected void processColumn(StringBuffer buf, DbAttribute dbAttr)
protected void appendLiteral(StringBuffer buf, Object val, DbAttribute attr, Expression parentExpression)
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.
buf
- query buffer.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.protected void appendLiteralDirect(StringBuffer buf, Object val, DbAttribute attr, Expression parentExpression)
val
as a
parameter to the PreparedStatement being built. Adds val
into QueryAssembler parameter list.
buf
- query bufferval
- object that should be appended as a literal to the query.
Must be of one of "standard JDBC" types. Can not be null.protected DbAttribute paramsDbType(Expression e)
protected void processRelTermination(StringBuffer buf, ObjRelationship rel)
protected void processRelTermination(StringBuffer buf, DbRelationship rel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |