public abstract class DatabaseCall extends DatasourceCall
Modifier and Type | Field and Description |
---|---|
static DatabaseField |
FIRSTRESULT_FIELD |
static DatabaseField |
MAXROW_FIELD
Following fields are used to bind MaxResults and FirstRow settings into
the query instead of using the values stored in the call.
|
CUSTOM_MODIFY, IN, INLINE, INOUT, LITERAL, MODIFY, OUT, OUT_CURSOR, TRANSLATION
Constructor and Description |
---|
DatabaseCall() |
Modifier and Type | Method and Description |
---|---|
void |
addContext(DatabaseField field,
java.lang.Object value)
INTERNAL:
Add a field - value pair for LOB field into the context.
|
void |
appendIn(java.lang.Object inObject)
INTERNAL:
|
void |
appendInOut(DatabaseField inoutField)
INTERNAL:
|
void |
appendInOut(java.lang.Object inValueOrField,
DatabaseField outField)
INTERNAL:
|
static void |
appendLogParameters(java.util.Collection parameters,
Accessor accessor,
java.io.StringWriter writer,
AbstractSession session)
Print the parameters to the write for logging purposes.
|
void |
appendOut(DatabaseField outField)
INTERNAL:
|
void |
appendOutCursor(DatabaseField outField)
INTERNAL:
|
void |
appendParameter(java.io.Writer writer,
java.lang.Object parameter,
AbstractSession session)
Add the parameter.
|
void |
bindParameter(java.io.Writer writer,
java.lang.Object parameter)
Bind the parameter.
|
DatabaseQueryMechanism |
buildNewQueryMechanism(DatabaseQuery query)
Return the appropriate mechanism,
with the call added as necessary.
|
AbstractRecord |
buildOutputRow(java.sql.CallableStatement statement,
DatabaseAccessor accessor,
AbstractSession session)
INTERNAL:
Return Record containing output fields and values.
|
DatabaseQueryMechanism |
buildQueryMechanism(DatabaseQuery query,
DatabaseQueryMechanism mechanism)
Return the appropriate mechanism,
with the call added as necessary.
|
java.lang.String |
getCallString()
INTERNAL:
Return the SQL string for the call.
|
AbstractRecord |
getContexts()
INTERNAL:
Return the contexts (for LOB)
|
int |
getCursorOutIndex()
INTERNAL:
Return 1-based index of out cursor parameter, or -1.
|
boolean |
getExecuteReturnValue()
After an execute call the return value can be retrieved here.
|
java.util.Vector |
getFields()
The fields expected by the calls result set.
|
DatabaseField[] |
getFieldsArray()
INTERNAL:
The array of fields returned by the call.
|
int |
getFirstResult()
get first result
|
java.lang.String |
getLogString(Accessor accessor)
Return the SQL string for logging purposes.
|
int |
getMaxRows()
get max rows returned from the call
|
java.util.List<DatabaseField> |
getOutputCursors()
INTERNAL:
Return the output cursors for this stored procedure call.
|
java.util.Vector |
getOutputRowFields()
INTERNAL
Returns the fields to be used in output row.
|
java.lang.String |
getQueryString()
INTERNAL:
Return the query string (SQL) of the call.
|
int |
getQueryTimeout()
Get timeout limit from the call
|
java.sql.ResultSet |
getResult()
The result set is stored for the return value of cursor selects.
|
int |
getResultSetConcurrency() |
int |
getResultSetFetchSize() |
int |
getResultSetType() |
boolean |
getReturnsResultSet()
ADVANCED:
This method returns a value that represents if the customer has set whether or not EclipseLink should expect
the stored procedure to returning a JDBC ResultSet.
|
java.lang.String |
getSQLString()
Return the SQL string that will be executed.
|
java.sql.Statement |
getStatement()
The statement is stored for the return value of cursor selects.
|
boolean |
hasAllocatedConnection()
INTERNAL:
|
boolean |
hasMultipleResultSets()
Return if the call returns multiple result sets.
|
boolean |
hasOptimisticLock()
This check is needed only when doing batch writing.
|
boolean |
hasOutputCursors()
Return true if there are output cursors on this call.
|
boolean |
isBatchExecutionSupported()
INTERNAL:
Return if this query is compatible with batch writing.
|
boolean |
isCursorOutputProcedure()
Used for Oracle result sets through procedures.
|
boolean |
isCursorReturned()
The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
|
boolean |
isFieldMatchingRequired()
Return if field matching is required.
|
boolean |
isFinished()
Return whether all the results of the call have been returned.
|
boolean |
isLOBLocatorNeeded()
INTERNAL:
Return if the locator is required for the LOB (BLOB and CLOB) writing.
|
boolean |
isMultipleCursorOutputProcedure()
Used for Oracle result sets through procedures.
|
boolean |
isNonCursorOutputProcedure()
Return true for procedures with any output (or in/out) parameters and no cursors
|
boolean |
isResultSetScrollable() |
boolean |
isUsesBindingSet()
INTERNAL
Indicates whether usesBinding has been set.
|
void |
matchFieldOrder(java.sql.ResultSet resultSet,
DatabaseAccessor accessor,
AbstractSession session)
Allow for the field order to be matched if required.
|
void |
prepare(AbstractSession session)
INTERNAL:
Allow pre-printing of the SQL string for fully bound calls, to save from reprinting.
|
java.sql.Statement |
prepareStatement(DatabaseAccessor accessor,
AbstractRecord translationRow,
AbstractSession session)
INTERNAL:
Prepare the JDBC statement, this may be parameterize or a call statement.
|
boolean |
returnMultipleResultSetCollections()
Return true if the multiple results 'lists' should be returned.
|
void |
setBatchExecutionSupported(boolean isBatchExecutionSupported)
INTERNAL:
Set if this query is compatible with batch writing.
|
void |
setContexts(AbstractRecord contexts)
INTERNAL:
Set the contexts (for LOB)
|
void |
setExecuteReturnValue(boolean value)
An execute return value will be set here after the call.
|
void |
setFields(java.util.Vector fields)
The fields expected by the calls result set.
|
void |
setFirstResult(int firstResult)
The firstResult set on the result set
|
void |
setHasAllocatedConnection(boolean hasAllocatedConnection)
INTERNAL:
|
void |
setHasMultipleResultSets(boolean hasMultipleResultSets)
Set if the call returns multiple result sets.
|
void |
setHasOptimisticLock(boolean hasOptimisticLock)
This check is needed only when doing batch writing and we hit on optimistic locking.
|
void |
setIgnoreFirstRowSetting(boolean ignoreFirstRowSetting)
INTERNAL:
Sets the ignoreFirstRowSetting flag.
|
void |
setIgnoreMaxResultsSetting(boolean ignoreMaxResultsSetting)
INTERNAL:
Sets the ignoreMaxResultsSetting flag.
|
void |
setIsCursorOutputProcedure(boolean isCursorOutputProcedure)
Used for Oracle result sets through procedures.
|
void |
setIsFieldMatchingRequired(boolean isFieldMatchingRequired)
Field matching is required for custom SQL statements where the result set field order is not known.
|
void |
setIsMultipleCursorOutputProcedure(boolean isMultipleCursorOutputProcedure)
Used for Oracle result sets through procedures.
|
void |
setIsResultSetScrollable(boolean isResultSetScrollable) |
void |
setMaxRows(int maxRows)
set query max returned row size to the JDBC Statement
|
void |
setQueryString(java.lang.String queryString)
INTERNAL:
Set the query string (SQL) of the call.
|
void |
setQueryTimeout(int queryTimeout)
set query timeout limit to the JDBC Statement
|
void |
setResult(java.sql.ResultSet result)
The result set is stored for the return value of cursor selects.
|
void |
setResultSetConcurrency(int resultSetConcurrency) |
void |
setResultSetFetchSize(int resultSetFetchSize) |
void |
setResultSetType(int resultSetType) |
void |
setReturnMultipleResultSetCollections(boolean returnMultipleResultSetCollections)
Set if the call returns multiple result sets.
|
void |
setReturnsResultSet(boolean returnsResultSet)
PUBLIC:
Use this method to tell EclipseLink that the stored procedure will be returning a JDBC ResultSet
|
void |
setShouldCacheStatement(boolean shouldCacheStatement)
Bound calls can use prepared statement caching.
|
void |
setStatement(java.sql.Statement statement)
The statement is stored for the return value of cursor selects.
|
void |
setUsesBinding(boolean usesBinding)
The call may specify that its parameters should be bound.
|
boolean |
shouldBuildOutputRow()
Set whether the call has to build output row
|
boolean |
shouldCacheStatement(AbstractSession session)
Bound calls can use prepared statement caching.
|
boolean |
shouldCacheStatement(DatabasePlatform databasePlatform)
Bound calls can use prepared statement caching.
|
boolean |
shouldIgnoreFirstRowSetting()
INTERNAL:
Returns the ignoreFirstRowSetting flag.
|
boolean |
shouldIgnoreMaxResultsSetting()
INTERNAL:
Returns the ignoreMaxResultsSetting flag.
|
java.lang.String |
toString()
INTERNAL:
Print the SQL string.
|
void |
translate(AbstractRecord translationRow,
AbstractRecord modifyRow,
AbstractSession session)
INTERNAL:
Allow the call to translate from the translation for predefined calls.
|
void |
translateQueryStringForParameterizedIN(AbstractRecord translationRow,
AbstractRecord modifyRow,
AbstractSession session)
INTERNAL:
Translate only IN() parameter values (List parameters).
|
boolean |
usesBinding(AbstractSession session)
The call may specify that its parameters should be bound.
|
boolean |
usesBinding(DatabasePlatform databasePlatform)
The call may specify that its parameters should be bound.
|
void |
useUnnamedCursorOutputAsResultSet()
PUBLIC:
Used for Oracle result sets through procedures.
|
appendIn, appendInOut, appendLiteral, appendModify, appendOut, appendTranslation, areManyRowsReturned, clone, getParameters, getParameterTypes, getQuery, getReturnType, hasParameters, isEISInteraction, isExecuteUpdate, isJPQLCall, isNativeConnectionRequired, isNothingReturned, isOneRowReturned, isOutputParameterType, isPrepared, isQueryStringCall, isReturnSet, isSQLCall, isStoredFunctionCall, isStoredPLSQLFunctionCall, isStoredPLSQLProcedureCall, isStoredProcedureCall, returnCursor, returnManyRows, returnNothing, returnOneRow, setExecuteUpdate, setIsNativeConnectionRequired, setIsPrepared, setParameters, setParameterTypes, setQuery, setReturnType, translateCustomQuery, translatePureSQLCustomQuery, translateQueryString
public static DatabaseField MAXROW_FIELD
public static DatabaseField FIRSTRESULT_FIELD
public boolean hasMultipleResultSets()
public void setHasMultipleResultSets(boolean hasMultipleResultSets)
public void appendIn(java.lang.Object inObject)
public void appendInOut(DatabaseField inoutField)
public void appendInOut(java.lang.Object inValueOrField, DatabaseField outField)
public void appendOut(DatabaseField outField)
public void appendOutCursor(DatabaseField outField)
public void appendParameter(java.io.Writer writer, java.lang.Object parameter, AbstractSession session)
appendParameter
in class DatasourceCall
public void bindParameter(java.io.Writer writer, java.lang.Object parameter)
public DatabaseQueryMechanism buildNewQueryMechanism(DatabaseQuery query)
buildNewQueryMechanism
in interface Call
buildNewQueryMechanism
in class DatasourceCall
public AbstractRecord buildOutputRow(java.sql.CallableStatement statement, DatabaseAccessor accessor, AbstractSession session) throws java.sql.SQLException
java.sql.SQLException
public DatabaseQueryMechanism buildQueryMechanism(DatabaseQuery query, DatabaseQueryMechanism mechanism)
buildQueryMechanism
in interface Call
buildQueryMechanism
in class DatasourceCall
public java.lang.String getCallString()
public java.util.Vector getFields()
public DatabaseField[] getFieldsArray()
public int getCursorOutIndex()
public boolean getExecuteReturnValue()
public int getFirstResult()
public java.lang.String getLogString(Accessor accessor)
getLogString
in interface Call
getLogString
in class DatasourceCall
public static void appendLogParameters(java.util.Collection parameters, Accessor accessor, java.io.StringWriter writer, AbstractSession session)
public int getMaxRows()
public java.util.Vector getOutputRowFields()
public java.util.List<DatabaseField> getOutputCursors()
public java.lang.String getQueryString()
getQueryString
in class DatasourceCall
public int getQueryTimeout()
public java.sql.ResultSet getResult()
public boolean getReturnsResultSet()
public int getResultSetConcurrency()
public int getResultSetFetchSize()
public int getResultSetType()
public java.lang.String getSQLString()
public java.sql.Statement getStatement()
public boolean hasOptimisticLock()
public boolean hasOutputCursors()
public boolean isCursorOutputProcedure()
public boolean isCursorReturned()
isCursorReturned
in class DatasourceCall
public boolean isFieldMatchingRequired()
public boolean isFinished()
isFinished
in interface Call
isFinished
in class DatasourceCall
public boolean isMultipleCursorOutputProcedure()
public boolean isNonCursorOutputProcedure()
public boolean isResultSetScrollable()
public void matchFieldOrder(java.sql.ResultSet resultSet, DatabaseAccessor accessor, AbstractSession session)
public void prepare(AbstractSession session)
prepare
in class DatasourceCall
public java.sql.Statement prepareStatement(DatabaseAccessor accessor, AbstractRecord translationRow, AbstractSession session) throws java.sql.SQLException
java.sql.SQLException
public boolean returnMultipleResultSetCollections()
public void setFields(java.util.Vector fields)
public void setFirstResult(int firstResult)
public void setHasOptimisticLock(boolean hasOptimisticLock)
public void setIgnoreFirstRowSetting(boolean ignoreFirstRowSetting)
public void setIgnoreMaxResultsSetting(boolean ignoreMaxResultsSetting)
public void setIsCursorOutputProcedure(boolean isCursorOutputProcedure)
public void setIsFieldMatchingRequired(boolean isFieldMatchingRequired)
public void setIsMultipleCursorOutputProcedure(boolean isMultipleCursorOutputProcedure)
public void setIsResultSetScrollable(boolean isResultSetScrollable)
public void setMaxRows(int maxRows)
public void setQueryString(java.lang.String queryString)
setQueryString
in class DatasourceCall
public void setQueryTimeout(int queryTimeout)
public void setResult(java.sql.ResultSet result)
public void setResultSetConcurrency(int resultSetConcurrency)
public void setResultSetFetchSize(int resultSetFetchSize)
public void setResultSetType(int resultSetType)
public void setReturnsResultSet(boolean returnsResultSet)
public void setReturnMultipleResultSetCollections(boolean returnMultipleResultSetCollections)
public void setShouldCacheStatement(boolean shouldCacheStatement)
public void setStatement(java.sql.Statement statement)
public void setUsesBinding(boolean usesBinding)
public boolean shouldBuildOutputRow()
public boolean shouldCacheStatement(AbstractSession session)
public boolean shouldCacheStatement(DatabasePlatform databasePlatform)
public boolean shouldIgnoreFirstRowSetting()
public boolean shouldIgnoreMaxResultsSetting()
public java.lang.String toString()
toString
in class java.lang.Object
public void translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
translate
in class DatasourceCall
public void translateQueryStringForParameterizedIN(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)
public boolean usesBinding(AbstractSession session)
public boolean usesBinding(DatabasePlatform databasePlatform)
public boolean isUsesBindingSet()
public boolean isLOBLocatorNeeded()
public void addContext(DatabaseField field, java.lang.Object value)
public AbstractRecord getContexts()
public void setContexts(AbstractRecord contexts)
public void setExecuteReturnValue(boolean value)
public void useUnnamedCursorOutputAsResultSet()
public boolean isBatchExecutionSupported()
public void setBatchExecutionSupported(boolean isBatchExecutionSupported)
public boolean hasAllocatedConnection()
public void setHasAllocatedConnection(boolean hasAllocatedConnection)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference