public abstract class DatasourceCall extends java.lang.Object implements Call
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
CUSTOM_MODIFY |
static java.lang.Integer |
IN |
static java.lang.Integer |
INOUT |
protected boolean |
isPrepared |
static java.lang.Integer |
LITERAL |
static java.lang.Integer |
MODIFY |
protected static int |
NO_RETURN |
static java.lang.Integer |
OUT |
static java.lang.Integer |
OUT_CURSOR |
protected java.util.Vector |
parameters |
protected java.util.Vector |
parameterTypes |
protected DatabaseQuery |
query |
protected static int |
RETURN_CURSOR |
protected static int |
RETURN_MANY_ROWS |
protected static int |
RETURN_ONE_ROW |
protected int |
returnType |
static java.lang.Integer |
TRANSLATION |
Constructor and Description |
---|
DatasourceCall() |
Modifier and Type | Method and Description |
---|---|
void |
appendIn(java.io.Writer writer,
DatabaseField field)
INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
|
void |
appendInOut(java.io.Writer writer,
DatabaseField inoutField)
INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
|
void |
appendLiteral(java.io.Writer writer,
java.lang.Object literal)
INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
|
void |
appendModify(java.io.Writer writer,
DatabaseField modifyField)
INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
|
void |
appendOut(java.io.Writer writer,
DatabaseField outField)
INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
|
void |
appendParameter(java.io.Writer writer,
java.lang.Object parameter,
AbstractSession session)
Add the parameter.
|
void |
appendTranslation(java.io.Writer writer,
DatabaseField modifyField)
INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
|
boolean |
areManyRowsReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
protected char |
argumentMarker()
INTERNAL:
Return the character to use for the argument marker.
|
DatabaseQueryMechanism |
buildNewQueryMechanism(DatabaseQuery query)
Return the appropriate mechanism,
with the call added as necessary.
|
DatabaseQueryMechanism |
buildQueryMechanism(DatabaseQuery query,
DatabaseQueryMechanism mechanism)
Return the appropriate mechanism,
with the call added as necessary.
|
java.lang.Object |
clone()
INTERNAL:
Return a clone of the call.
|
protected DatabaseField |
createField(java.lang.String fieldName)
INTERNAL:
Create a new Database Field
This method can be overridden by subclasses to return other field types
|
protected java.lang.Object |
createInOutParameter(java.lang.Object inValue,
java.lang.Object outParameter,
AbstractSession session)
INTERNAL:
Returns INOUT parameter.
|
abstract java.lang.String |
getLogString(Accessor accessor)
Return the SQL string for logging purposes.
|
java.util.Vector |
getParameters()
The parameters are the values in order of occurance in the SQL statement.
|
java.util.Vector |
getParameterTypes()
The parameter types determine if the parameter is a modify, translation or litteral type.
|
DatabaseQuery |
getQuery()
Back reference to query, unfortunately required for events.
|
java.lang.String |
getQueryString()
Return the query string of the call.
|
int |
getReturnType()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
protected java.lang.Object |
getValueForInOutParameter(java.lang.Object parameter,
AbstractRecord translationRow,
AbstractRecord modifyRow,
AbstractSession session)
INTERNAL:
Returns value for INOUT parameter.
|
protected java.lang.Object |
getValueForInParameter(java.lang.Object parameter,
AbstractRecord translationRow,
AbstractRecord modifyRow,
AbstractSession session,
boolean shouldBind)
INTERNAL:
Returns value for IN parameter.
|
boolean |
hasParameters()
The parameters are the values in order of occurance in call.
|
boolean |
isCursorReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
boolean |
isEISInteraction() |
boolean |
isEJBQLCall() |
boolean |
isFinished()
Return whether all the results of the call have been returned.
|
boolean |
isNothingReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
boolean |
isOneRowReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
boolean |
isOutputParameterType(java.lang.Integer parameterType) |
protected boolean |
isPrepared()
Bound calls can have the SQL pre generated.
|
boolean |
isQueryStringCall() |
boolean |
isSQLCall() |
boolean |
isStoredFunctionCall() |
boolean |
isStoredProcedureCall() |
void |
prepare(AbstractSession session)
Allow pre-printing of the query/SQL string for fully bound calls, to save from reprinting.
|
void |
returnCursor()
Cursor return is used for cursored streams.
|
void |
returnManyRows()
Many rows are returned for read-all queries.
|
void |
returnNothing()
No return is used for modify calls like insert / update / delete.
|
void |
returnOneRow()
One row is returned for read-object queries.
|
protected void |
setIsPrepared(boolean isPrepared)
Bound calls can have the SQL pre generated.
|
void |
setParameters(java.util.Vector parameters)
The parameters are the values in order of occurance in the SQL statement.
|
void |
setParameterTypes(java.util.Vector parameterTypes)
The parameter types determine if the parameter is a modify, translation or litteral type.
|
void |
setQuery(DatabaseQuery query)
Back reference to query, unfortunately required for events.
|
void |
setQueryString(java.lang.String queryString)
Set the query string of the call.
|
void |
setReturnType(int returnType)
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
void |
translate(AbstractRecord translationRow,
AbstractRecord modifyRow,
AbstractSession session)
Allow the call to translate from the translation for predefined calls.
|
void |
translateCustomQuery()
INTERNAL:
Parse the query string for # markers for custom query based on a query language.
|
void |
translatePureSQLCustomQuery()
INTERNAL:
Parse the query string for # markers for custom query based on a query language.
|
void |
translateQueryString(AbstractRecord translationRow,
AbstractRecord modifyRow,
AbstractSession session)
INTERNAL:
Allow the call to translate from the translation for predefined calls.
|
protected java.lang.String |
whitespace()
INTERNAL:
Return the characters that represent non-arguments names.
|
protected DatabaseQuery query
protected transient java.util.Vector parameters
protected transient java.util.Vector parameterTypes
public static final java.lang.Integer LITERAL
public static final java.lang.Integer MODIFY
public static final java.lang.Integer TRANSLATION
public static final java.lang.Integer CUSTOM_MODIFY
public static final java.lang.Integer OUT
public static final java.lang.Integer INOUT
public static final java.lang.Integer IN
public static final java.lang.Integer OUT_CURSOR
protected boolean isPrepared
protected int returnType
protected static final int NO_RETURN
protected static final int RETURN_ONE_ROW
protected static final int RETURN_MANY_ROWS
protected static final int RETURN_CURSOR
public java.util.Vector getParameters()
public java.util.Vector getParameterTypes()
public void setParameters(java.util.Vector parameters)
public void setParameterTypes(java.util.Vector parameterTypes)
public boolean hasParameters()
public boolean areManyRowsReturned()
public boolean isOutputParameterType(java.lang.Integer parameterType)
protected boolean isPrepared()
protected void setIsPrepared(boolean isPrepared)
public DatabaseQueryMechanism buildNewQueryMechanism(DatabaseQuery query)
buildNewQueryMechanism
in interface Call
public DatabaseQueryMechanism buildQueryMechanism(DatabaseQuery query, DatabaseQueryMechanism mechanism)
buildQueryMechanism
in interface Call
public java.lang.Object clone()
Call
public abstract java.lang.String getLogString(Accessor accessor)
getLogString
in interface Call
public DatabaseQuery getQuery()
public int getReturnType()
public boolean isCursorReturned()
public boolean isFinished()
isFinished
in interface Call
public boolean isNothingReturned()
public boolean isOneRowReturned()
public boolean isSQLCall()
public boolean isStoredFunctionCall()
public boolean isStoredProcedureCall()
public boolean isEJBQLCall()
public boolean isEISInteraction()
public boolean isQueryStringCall()
public void prepare(AbstractSession session)
public void returnCursor()
public void returnManyRows()
public void returnNothing()
public void returnOneRow()
public void setQuery(DatabaseQuery query)
public void setReturnType(int returnType)
public void translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
public java.lang.String getQueryString()
public void setQueryString(java.lang.String queryString)
public void translateCustomQuery()
public void translatePureSQLCustomQuery()
protected DatabaseField createField(java.lang.String fieldName)
public void appendLiteral(java.io.Writer writer, java.lang.Object literal)
public void appendTranslation(java.io.Writer writer, DatabaseField modifyField)
public void appendModify(java.io.Writer writer, DatabaseField modifyField)
public void appendIn(java.io.Writer writer, DatabaseField field)
public void appendInOut(java.io.Writer writer, DatabaseField inoutField)
public void appendOut(java.io.Writer writer, DatabaseField outField)
public void appendParameter(java.io.Writer writer, java.lang.Object parameter, AbstractSession session)
protected char argumentMarker()
protected java.lang.String whitespace()
public void translateQueryString(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
protected java.lang.Object getValueForInParameter(java.lang.Object parameter, AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session, boolean shouldBind)
protected java.lang.Object getValueForInOutParameter(java.lang.Object parameter, AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
protected java.lang.Object createInOutParameter(java.lang.Object inValue, java.lang.Object outParameter, AbstractSession session)