Top Description Fields Constructors Methods
org.eclipse.persistence.queries

public Class StoredProcedureCall

extends DatabaseCall
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall, org.eclipse.persistence.queries.StoredFunctionCall
Imports
java.io.IOException, .StringWriter, .Writer, java.sql.CallableStatement, .PreparedStatement, .SQLException, .Statement, java.util.ArrayList, .Collection, .List, java.util.concurrent.TimeUnit, org.eclipse.persistence.exceptions.QueryException, .ValidationException, org.eclipse.persistence.internal.databaseaccess.Accessor, .DatabaseAccessor, .DatabaseCall, .DatabasePlatform, org.eclipse.persistence.internal.helper.DatabaseField, .Helper, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.mappings.structures.ObjectRelationalDatabaseField

Purpose: Used to define a platform independent procedure call. This supports output parameters. Procedures can also be called through custom SQL.

Field Summary

Modifier and TypeField and Description
protected List<DatabaseField>
protected List<String>
protected String
Inherited from org.eclipse.persistence.internal.databaseaccess.DatabaseCall:
executeReturnValuefieldsfieldsArrayfirstResultFIRSTRESULT_FIELDgeneratedKeyshasAllocatedConnectionhasMultipleResultSetshasOptimisticLockignoreFirstRowSettingignoreMaxResultsSettingisBatchExecutionSupportedisCallableStatementRequiredisCursorOutputProcedureisFieldMatchingRequiredisMultipleCursorOutputProcedureisResultSetScrollableMAXROW_FIELDmaxRowsqueryTimeoutqueryTimeoutUnitresultresultSetConcurrencyresultSetFetchSizeresultSetTypereturnMultipleResultSetCollectionsreturnsResultSetshouldBuildOutputRowshouldCacheStatementshouldReturnGeneratedKeyssqlStringstatementusesBinding

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addNamedArgument(String procedureParameterAndArgumentFieldName)

PUBLIC: Define the argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName)

PUBLIC: Define the argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName, Class<?> type)

PUBLIC: Define the input argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName, int type)

PUBLIC: Define the input argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName, int type, String typeName)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName, int type, String typeName, Class<?> javaType)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName, int type, String typeName, Class<?> javaType, DatabaseField nestedType)

PUBLIC: Define the inout argument to the stored procedure and the field/argument name to be substituted for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName, int type, String typeName, String javaTypeName)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgument(String procedureParameterName, String argumentFieldName, int type, String typeName, DatabaseField nestedType)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedArgumentValue(String procedureParameterName, Object argumentValue)

PUBLIC: Define the argument to the stored procedure and the value to be substitute for it.

public void
addNamedCursorOutputArgument(String argumentName)

ADVANCED: Add the cursor output parameter to the procedure.

public void
addNamedInOutputArgument(String procedureParameterAndArgumentFieldName)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgument(String procedureParameterName, String argumentFieldName)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgument(String procedureParameterName, String argumentFieldName, Class<?> type)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgument(String procedureParameterName, String inArgumentFieldName, String outArgumentFieldName, Class<?> type)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgument(String procedureParameterName, String inArgumentFieldName, String outArgumentFieldName, int type)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgument(String procedureParameterName, String inArgumentFieldName, String outArgumentFieldName, int type, String typeName)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgument(String procedureParameterName, String inArgumentFieldName, String outArgumentFieldName, int type, String typeName, Class<?> classType)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgument(String procedureParameterName, String inArgumentFieldName, String outArgumentFieldName, int type, String typeName, Class<?> javaType, DatabaseField nestedType)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedInOutputArgumentValue(String procedureParameterName, Object inArgumentValue, String outArgumentFieldName, Class<?> type)

PUBLIC: Define the inoutput argument to the stored procedure and the field/argument name to be substitute for it on the way in and out.

public void
addNamedOutputArgument(String procedureParameterAndArgumentFieldName)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedOutputArgument(String procedureParameterName, String argumentFieldName)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedOutputArgument(String procedureParameterName, String argumentFieldName, Class<?> type)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedOutputArgument(String procedureParameterName, String argumentFieldName, int type)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedOutputArgument(String procedureParameterName, String argumentFieldName, int type, String typeName)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedOutputArgument(String procedureParameterName, String argumentFieldName, int jdbcType, String typeName, Class<?> javaType)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addNamedOutputArgument(String procedureParameterName, String argumentFieldName, int jdbcType, String typeName, Class<?> javaType, DatabaseField nestedType)

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.

public void
addOptionalArgument(String argument)

PUBLIC: Add the optional argument.

public void
addUnamedArgument(String argumentFieldName)

PUBLIC: Define the field/argument name to be substitute for the index argument.

public void
addUnamedArgument(String argumentFieldName, Class<?> type)

PUBLIC: Define the argument to the stored procedure for the index argument.

public void
addUnamedArgument(String argumentFieldName, int type)

PUBLIC: Define the argument to the stored procedure for the index argument.

public void
addUnamedArgument(String argumentFieldName, int type, String typeName)

PUBLIC: Define the argument to the stored procedure for the index argument.

public void
addUnamedArgument(String argumentFieldName, int type, String typeName, DatabaseField nestedType)

PUBLIC: Define the argument to the stored procedure for the index argument.

public void
addUnamedArgumentValue(Object argumentValue)

PUBLIC: Define the argument to the stored procedure for the index argument.

public void
addUnamedInOutputArgument(String inArgumentFieldName, String outArgumentFieldName, Class<?> type)

PUBLIC: Define the argument to the stored procedure for the index argument.

public void
addUnamedInOutputArgument(String inArgumentFieldName, String outArgumentFieldName, int type)

PUBLIC: Define the argument to the stored procedure for the index argument.

public void
addUnamedInOutputArgument(String inArgumentFieldName, String outArgumentFieldName, int type, String typeName)

PUBLIC: Define the inoutput argument to the stored procedure for the index argument and the field/argument name to be substitute for it on the way in and out.

public void
addUnamedInOutputArgument(String argumentFieldName, Class<?> type)

PUBLIC: Define the inoutput argument to the stored procedure for the index argument and the field/argument name to be substitute for it on the way in and out.

public void
addUnamedInOutputArgument(String argumentFieldName)

PUBLIC: Define the inoutput argument to the stored procedure for the index argument and the field/argument name to be substitute for it on the way in and out.

public void
addUnamedInOutputArgument(String inArgumentFieldName, String outArgumentFieldName, int type, String typeName, Class<?> collection)

PUBLIC: Define the inoutput argument to the stored procedure for the index argument and the field/argument name to be substitute for it on the way in and out.

public void
addUnamedInOutputArgument(String inArgumentFieldName, String outArgumentFieldName, int type, String typeName, Class<?> collection, DatabaseField nestedType)

PUBLIC: Define the inoutput argument to the stored procedure for the index argument and the field/argument name to be substitute for it on the way in and out.

public void
addUnamedInOutputArgumentValue(Object inArgumentValue, String outArgumentFieldName, Class<?> type)

PUBLIC: Define the inoutput argument to the stored procedure for the index argument and the field/argument name to be substitute for it on the way in and out.

public void
addUnamedOutputArgument(String argumentFieldName)

PUBLIC: Define the field/argument name to be substitute for the index output argument.

public void
addUnamedOutputArgument(String argumentFieldName, Class<?> type)

PUBLIC: Define the field/argument name to be substitute for the index output argument.

public void
addUnamedOutputArgument(String argumentFieldName, int type)

PUBLIC: Define the field/argument name to be substitute for the index output argument.

public void
addUnamedOutputArgument(String argumentFieldName, int type, String typeName)

PUBLIC: Define the field/argument name to be substitute for the index output argument.

public void
addUnamedOutputArgument(String argumentFieldName, int jdbcType, String typeName, Class<?> javaType)

PUBLIC: Define the field/argument name to be substitute for the index output argument.

public void
addUnamedOutputArgument(String argumentFieldName, int jdbcType, String typeName, Class<?> javaType, DatabaseField nestedType)

PUBLIC: Define the field/argument name to be substitute for the index output argument.

public void
addUnnamedCursorOutputArgument(String outputRowFieldName)

ADVANCED: Add the cursor output parameter to the procedure.

public void
public String
getCallHeader(DatabasePlatform platform)

INTERNAL: Return call header for the call string.

public int
getFirstParameterIndexForCallString()

INTERNAL: Return the first index of parameter to be placed inside brackets in the call string

public String
public List<DatabaseField>
getOptionalArguments()

INTERNAL: Return the list of optional arguments.

public Object
getOutputParameterValue(CallableStatement
SQL/JDBC statement to call stored procedure/function
statement
,
int
0-based index in the argument list
index
,
AbstractSession
Active database session (in connected state).
session
)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabaseCall.getOutputParameterValue.

INTERNAL: Get the return object from the statement.
public List<String>
getProcedureArgumentNames()

INTERNAL: The if the names are provide the order is not required to match the call def.

public String
getProcedureName()

PUBLIC: Return the name of the store procedure on the database.

public boolean
hasOptionalArguments()

INTERNAL: Return if there are any optional arguments.

protected boolean
isCallableStatementRequired()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabaseCall.isCallableStatementRequired.

Callable statements are used for StoredProcedures that have argument names (named parameters)
private boolean
isIndexBased(List<String> procedureArgs, AbstractSession session)

public boolean
protected void
public Statement
prepareStatement(DatabaseAccessor accessor, AbstractRecord translationRow, AbstractSession session)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabaseCall.prepareStatement.

INTERNAL: Prepare the JDBC statement, this may be parameterize or a call statement.
public void
setHasMultipleResultSets(boolean hasMultipleResultSets)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabaseCall.setHasMultipleResultSets.

PUBLIC: Set if the call returns multiple result sets.
public void
setOptionalArguments(List<DatabaseField> optionalArguments)

INTERNAL: Set the list of optional arguments.

public void
setProcedureArgumentNames(List<String> procedureArgumentNames)

INTERNAL: The if the names are provide the order is not required to match the call def.

public void
setProcedureName(String procedureName)

PUBLIC: (REQUIRED) Set the name of the store procedure on the database.

public void
setReturnsResultSet(boolean returnsResultSet)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabaseCall.setReturnsResultSet.

PUBLIC: Some database support stored procedures returning result sets.
public String
protected void
useCursorOutputResultSet(String argumentName, String outputFieldName)

INTERNAL: Add the unnamed output cursor to return the result.

public void
useNamedCursorOutputAsResultSet(String argumentName)

PUBLIC: Used for Oracle result sets through procedures.

public void
public void
useUnnamedCursorOutputAsResultSet(int position)

PUBLIC: Used for Oracle result sets through procedures.

Inherited from org.eclipse.persistence.internal.databaseaccess.DatabaseCall:
addContextappendLogParametersappendParameterbuildNewQueryMechanismbuildOutputRowbuildQueryMechanismcreateInOutParametergetCallStringgetContextsgetCursorOutIndexgetExecuteReturnValuegetFieldsgetFieldsArraygetFieldWithTypeFromDescriptorgetFirstResultgetGeneratedKeysgetMaxRowsgetOutputParameterValuegetOutputRowFieldsgetQueryStringgetQueryTimeoutgetResultgetResultSetConcurrencygetResultSetFetchSizegetResultSetTypegetReturnsResultSetgetSQLStringgetStatementhasAllocatedConnectionhasMultipleResultSetshasOptimisticLockisBatchExecutionSupportedisCursorOutputProcedureisCursorReturnedisDynamicCallisFieldMatchingRequiredisFinishedisLOBLocatorNeededisMultipleCursorOutputProcedureisNonCursorOutputProcedureisResultSetScrollablematchFieldOrderprepareprepareInternalParametersreturnMultipleResultSetCollectionssetBatchExecutionSupportedsetContextssetExecuteReturnValuesetFieldssetFirstResultsetGeneratedKeyssetHasAllocatedConnectionsetHasOptimisticLocksetIgnoreFirstRowSettingsetIgnoreMaxResultsSettingsetIsCallableStatementRequiredsetIsCursorOutputProceduresetIsFieldMatchingRequiredsetIsMultipleCursorOutputProceduresetIsResultSetScrollablesetMaxRowssetQueryStringsetQueryTimeoutsetQueryTimeoutUnitsetResultsetResultSetConcurrencysetResultSetFetchSizesetResultSetTypesetReturnMultipleResultSetCollectionssetShouldBuildOutputRowsetShouldCacheStatementsetShouldReturnGeneratedKeyssetSQLStringInternalsetStatementshouldBuildOutputRowshouldCacheStatementshouldCacheStatementshouldIgnoreFirstRowSettingshouldIgnoreMaxResultsSettingshouldReturnGeneratedKeystranslate