public abstract class DatasourceCall extends Object implements Call
Modifier and Type | Field and Description |
---|---|
static Integer |
CUSTOM_MODIFY |
static Integer |
IN |
static Integer |
INOUT |
protected boolean |
isPrepared |
static Integer |
LITERAL |
static Integer |
MODIFY |
protected static int |
NO_RETURN |
static Integer |
OUT |
static Integer |
OUT_CURSOR |
protected Vector |
parameters |
protected 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 Integer |
TRANSLATION |
Constructor and Description |
---|
DatasourceCall() |
Modifier and Type | Method and Description |
---|---|
void |
appendIn(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(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(Writer writer,
Object literal)
INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
|
void |
appendModify(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(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(Writer writer,
Object parameter,
AbstractSession session)
Add the parameter.
|
void |
appendTranslation(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.
|
Object |
clone()
INTERNAL:
Return a clone of the call.
|
protected DatabaseField |
createField(String fieldName)
INTERNAL:
Create a new Database Field
This method can be overridden by subclasses to return other field types
|
protected Object |
createInOutParameter(Object inValue,
Object outParameter,
AbstractSession session)
INTERNAL:
Returns INOUT parameter.
|
abstract String |
getLogString(Accessor accessor)
Return the SQL string for logging purposes.
|
Vector |
getParameters()
The parameters are the values in order of occurance in the SQL statement.
|
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.
|
String |
getQueryString()
Return the query string of the call.
|
int |
getReturnType()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
protected Object |
getValueForInOutParameter(Object parameter,
AbstractRecord translationRow,
AbstractRecord modifyRow,
AbstractSession session)
INTERNAL:
Returns value for INOUT parameter.
|
protected Object |
getValueForInParameter(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(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(Vector parameters)
The parameters are the values in order of occurance in the SQL statement.
|
void |
setParameterTypes(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(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 String |
whitespace()
INTERNAL:
Return the characters that represent non-arguments names.
|
protected DatabaseQuery query
protected transient Vector parameters
protected transient Vector parameterTypes
public static final Integer LITERAL
public static final Integer MODIFY
public static final Integer TRANSLATION
public static final Integer CUSTOM_MODIFY
public static final Integer OUT
public static final Integer INOUT
public static final Integer IN
public static final 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 Vector getParameters()
public Vector getParameterTypes()
public void setParameters(Vector parameters)
public void setParameterTypes(Vector parameterTypes)
public boolean hasParameters()
public boolean areManyRowsReturned()
public boolean isOutputParameterType(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 Object clone()
Call
public abstract 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 String getQueryString()
public void setQueryString(String queryString)
public void translateCustomQuery()
public void translatePureSQLCustomQuery()
protected DatabaseField createField(String fieldName)
public void appendLiteral(Writer writer, Object literal)
public void appendTranslation(Writer writer, DatabaseField modifyField)
public void appendModify(Writer writer, DatabaseField modifyField)
public void appendIn(Writer writer, DatabaseField field)
public void appendInOut(Writer writer, DatabaseField inoutField)
public void appendOut(Writer writer, DatabaseField outField)
public void appendParameter(Writer writer, Object parameter, AbstractSession session)
protected char argumentMarker()
protected String whitespace()
public void translateQueryString(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
protected Object getValueForInParameter(Object parameter, AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session, boolean shouldBind)
protected Object getValueForInOutParameter(Object parameter, AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
protected Object createInOutParameter(Object inValue, Object outParameter, AbstractSession session)
Copyright © 2021. All rights reserved.