public abstract class DefaultBatchTranslator extends Object implements BatchTranslator
Modifier and Type | Field and Description |
---|---|
protected DbAdapter |
adapter |
protected DbAttributeBinding[] |
bindings |
protected BatchQuery |
query |
protected String |
sql |
protected boolean |
translated |
protected String |
trimFunction |
Constructor and Description |
---|
DefaultBatchTranslator(BatchQuery query,
DbAdapter adapter,
String trimFunction) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendDbAttribute(StringBuilder buf,
DbAttribute dbAttribute)
Appends the name of the column to the query buffer.
|
protected abstract DbAttributeBinding[] |
createBindings() |
protected abstract String |
createSql() |
protected abstract DbAttributeBinding[] |
doUpdateBindings(BatchQueryRow row) |
protected void |
ensureTranslated() |
DbAttributeBinding[] |
getBindings()
Returns the widest possible array of bindings for this query.
|
String |
getSql()
Translates BatchQuery into an SQL string formatted to use in a
PreparedStatement.
|
DbAttributeBinding[] |
updateBindings(BatchQueryRow row)
Updates internal bindings to be used with a given row, returning updated
bindings array.
|
protected BatchQuery query
protected DbAdapter adapter
protected String trimFunction
protected boolean translated
protected String sql
protected DbAttributeBinding[] bindings
public DefaultBatchTranslator(BatchQuery query, DbAdapter adapter, String trimFunction)
protected void ensureTranslated()
public String getSql()
getSql
in interface BatchTranslator
public DbAttributeBinding[] getBindings()
BatchTranslator
getBindings
in interface BatchTranslator
public DbAttributeBinding[] updateBindings(BatchQueryRow row)
BatchTranslator
BatchTranslator.getBindings()
(but in a state corresponding to the 'row'
parameter). Usually the returned array is actually the same object reused
for every iteration, only with changed object state.updateBindings
in interface BatchTranslator
protected abstract String createSql()
protected abstract DbAttributeBinding[] createBindings()
protected abstract DbAttributeBinding[] doUpdateBindings(BatchQueryRow row)
protected void appendDbAttribute(StringBuilder buf, DbAttribute dbAttribute)
Copyright © 2001–2019 Apache Cayenne. All rights reserved.