Top Description Inners Fields Constructors Methods
org.eclipse.persistence.platform.database.oracle.plsql

public Class PLSQLStoredProcedureCall

extends StoredProcedureCall
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredFunctionCall
Static Imports
java.lang.Integer.MIN_VALUE, org.eclipse.persistence.internal.helper.DatabaseType.DatabaseTypeHelper.databaseTypeHelper, .Helper.INDENT, .Helper.NL, org.eclipse.persistence.platform.database.jdbc.JDBCTypes.getDatabaseTypeForCode, org.eclipse.persistence.platform.database.oracle.plsql.OraclePLSQLType.PLSQLBoolean_IN_CONV, .OraclePLSQLType.PLSQLBoolean_OUT_CONV, .OraclePLSQLTypes.PLSQLBoolean, .OraclePLSQLTypes.XMLType

Purpose: Generates an Anonymous PL/SQL block to invoke the specified Stored Procedure with arguments that may or may not have JDBC equivalents. This handles conversion of PLSQL Record and Table types into SQL ARRAY (VARRAY) and STRUCT (OBJECT TYPE). It also handles conversion of flat PLSQL Record types and PLSQL BOOLEAN and other basic types.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
PLSQLStoredProcedureCall.InArgComparer

Class responsible for comparing PLSQLargument instances based on the inIndex property.

pack-priv static class
PLSQLStoredProcedureCall.OutArgComparer

Class responsible for comparing PLSQLargument instances based on the outIndex property.

pack-priv static class
PLSQLStoredProcedureCall.TypeInfo

INTERNAL: Helper structure used to store the PLSQL type conversion routines.

Field Summary

Modifier and TypeField and Description
protected List<PLSQLargument>
arguments

List of procedure IN/OUT/INOUT arguments.

pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
protected int
functionId

Id used to generate unique local functions.

protected int
originalIndex

Keeps track of the next procedure argument index.

pack-priv static final String
pack-priv static final String
pack-priv static final String
protected AbstractRecord
translationRow

Translation row stored after translation on the call clone, used only for logging.

private Map<String, PLSQLStoredProcedureCall.TypeInfo>
typesInfo

Map of conversion function routines for converting complex PLSQL types.

Inherited from org.eclipse.persistence.queries.StoredProcedureCall:
optionalArgumentsprocedureArgumentNamesprocedureName

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addNamedArgument(String procedureParameterName, DatabaseType databaseType)

PUBLIC: Add a named IN argument to the stored procedure.

public void
addNamedArgument(String procedureParameterName, DatabaseType databaseType, int length)

PUBLIC: Add a named IN argument to the stored procedure.

public void
addNamedArgument(String procedureParameterName, DatabaseType databaseType, int precision, int scale)

PUBLIC: Add a named IN argument to the stored procedure.

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

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedArgument.

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.
public void
addNamedArgument(String procedureParameterAndArgumentFieldName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedArgument.

PUBLIC: Define the argument to the stored procedure and the field/argument name to be substitute for it.
public void
addNamedArgumentValue(String procedureParameterName, Object argumentValue)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedArgumentValue.

PUBLIC: Define the argument to the stored procedure and the value to be substitute for it.
public void
addNamedInOutputArgument(String procedureParameterName, DatabaseType databaseType)

PUBLIC: Add a named IN OUT argument to the stored procedure.

public void
addNamedInOutputArgument(String procedureParameterName, DatabaseType databaseType, int length)

PUBLIC: Add a named IN OUT argument to the stored procedure.

public void
addNamedInOutputArgument(String procedureParameterName, DatabaseType databaseType, int precision, int scale)

PUBLIC: Add a named IN OUT argument to the stored procedure.

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

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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 procedureParameterAndArgumentFieldName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedInOutputArgumentValue.

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 procedureParameterName, DatabaseType databaseType)

PUBLIC: Add a named OUT argument to the stored procedure.

public void
addNamedOutputArgument(String procedureParameterName, DatabaseType databaseType, int length)

PUBLIC: Add a named OUT argument to the stored procedure.

public void
addNamedOutputArgument(String procedureParameterName, DatabaseType databaseType, int precision, int scale)

PUBLIC: Add a named OUT argument to the stored procedure.

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

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedOutputArgument.

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.
public void
addNamedOutputArgument(String procedureParameterAndArgumentFieldName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addNamedOutputArgument.

PUBLIC: Define the output argument to the stored procedure and the field/argument name to be substitute for it.
protected void
addNestedFunctionsForArgument(List<String> functions, PLSQLargument argument, DatabaseType databaseType, Set<DatabaseType> processed)

INTERNAL Add the nested function string required for the type and its subtypes.

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

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedArgument.

PUBLIC: Define the argument to the stored procedure for the index argument.
public void
addUnamedArgument(String argumentFieldName, int type, String typeName, DatabaseField nestedType)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedArgument.

PUBLIC: Define the argument to the stored procedure for the index argument.
public void
addUnamedArgument(String argumentFieldName, int type, String typeName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedArgument.

PUBLIC: Define the argument to the stored procedure for the index argument.
public void
addUnamedArgument(String argumentFieldName, int type)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedArgument.

PUBLIC: Define the argument to the stored procedure for the index argument.
public void
addUnamedArgument(String argumentFieldName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedArgument.

PUBLIC: Define the field/argument name to be substitute for the index argument.
public void
addUnamedArgumentValue(Object argumentValue)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedArgumentValue.

PUBLIC: Define the argument to the stored procedure for the index argument.
public void
addUnamedInOutputArgument(String argumentFieldName, Class<?> type)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgument.

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, Class<?> type)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgument.

PUBLIC: Define the argument to the stored procedure for the index argument.
public void
addUnamedInOutputArgument(String inArgumentFieldName, String outArgumentFieldName, int type, String typeName, Class<?> collection, DatabaseField nestedType)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgument.

PUBLIC: Define the argument to the stored procedure for the index argument.
public void
addUnamedInOutputArgument(String argumentFieldName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedInOutputArgumentValue.

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, Class<?> type)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedOutputArgument.

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)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedOutputArgument.

PUBLIC: Define the field/argument name to be substitute for the index output argument.
public void
addUnamedOutputArgument(String argumentFieldName, int type, String typeName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedOutputArgument.

PUBLIC: Define the field/argument name to be substitute for the index output argument.
public void
addUnamedOutputArgument(String argumentFieldName, int type)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedOutputArgument.

PUBLIC: Define the field/argument name to be substitute for the index output argument.
public void
addUnamedOutputArgument(String argumentFieldName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.addUnamedOutputArgument.

PUBLIC: Define the field/argument name to be substitute for the index output argument.
protected void
assignIndices()

INTERNAL compute the re-ordered indices - Do the IN args first, then the 'IN-half' of the INOUT args next, the OUT args, then the 'OUT-half' of the INOUT args

protected void
buildBeginBlock(StringBuilder sb, List<PLSQLargument> arguments)

INTERNAL Generate portion of the Anonymous PL/SQL block that assigns fields at the beginning of the BEGIN block (before invoking the target procedure).

protected void
buildDeclareBlock(StringBuilder sb, List<PLSQLargument> arguments)

INTERNAL Generate portion of the Anonymous PL/SQL block that declares the temporary variables in the DECLARE section.

protected void
buildNestedFunctions(StringBuilder stream, List<PLSQLargument> arguments)

INTERNAL Generate portion of the Anonymous PL/SQL block with PL/SQL conversion routines as nested functions.

protected void
buildOutAssignments(StringBuilder sb, List<PLSQLargument> arguments)

INTERNAL Generate portion of the Anonymous PL/SQL block after the target procedures has been invoked and OUT parameters must be handled.

public AbstractRecord
buildOutputRow(CallableStatement statement, DatabaseAccessor accessor, AbstractSession session)

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

Translate the SQL procedure output row, into the row expected by the PLSQL procedure.
protected void
buildProcedureInvocation(StringBuilder sb, List<PLSQLargument> arguments)

INTERNAL Generate portion of the Anonymous PL/SQL block that invokes the target procedure.

private PLSQLStoredProcedureCall.TypeInfo
generateNestedFunction(ComplexDatabaseType type)

INTERNAL: Generate the nested function to convert the PLSQL type to its compatible SQL type.

private PLSQLStoredProcedureCall.TypeInfo
generateNestedFunction(ComplexDatabaseType type, boolean isNonAssociativeCollection)

INTERNAL: Generate the nested function to convert the PLSQL type to its compatible SQL type.

protected static List<PLSQLargument>

Returns:

list of arguments with the specified direction
getArguments
(List<PLSQLargument> args, DatasourceCall.ParameterType direction)

INTERNAL

public List<PLSQLargument>
getArguments()

Return the PLSQL arguments.

public String
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.queries.StoredProcedureCall.getOutputParameterValue.

INTERNAL: Get the return object from the statement.
public String
getPl2SQLName(ComplexDatabaseType type)

Return the conversion function name, generate the function if missing.

public String
getSQL2PlName(ComplexDatabaseType type)

Return the conversion function name, generate the function if missing.

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

Overrides org.eclipse.persistence.queries.StoredProcedureCall.prepareStatement.

INTERNAL: Prepare the JDBC statement, this may be parameterize or a call statement.
public void
setArguments(List<PLSQLargument> arguments)

Set the PLSQL arguments.

public void
translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session)

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

Translate the PLSQL procedure translation row, into the row expected by the SQL procedure.
public void
useNamedCursorOutputAsResultSet(String argumentName)

Overrides org.eclipse.persistence.queries.StoredProcedureCall.useNamedCursorOutputAsResultSet.

PUBLIC: Used for Oracle result sets through procedures.
public void
useNamedCursorOutputAsResultSet(String argumentName, DatabaseType databaseType)

PUBLIC: Add a named OUT cursor argument to the stored procedure.

public void
Inherited from org.eclipse.persistence.queries.StoredProcedureCall:
addNamedArgumentaddNamedArgumentaddNamedArgumentaddNamedArgumentaddNamedArgumentaddNamedCursorOutputArgumentaddOptionalArgumentaddUnnamedCursorOutputArgumentbindParametergetCallHeadergetFirstParameterIndexForCallStringgetOptionalArgumentsgetProcedureArgumentNamesgetProcedureNamehasOptionalArgumentsisCallableStatementRequiredisStoredProcedureCallsetHasMultipleResultSetssetOptionalArgumentssetProcedureArgumentNamessetProcedureNamesetReturnsResultSettoStringuseCursorOutputResultSetuseUnnamedCursorOutputAsResultSet