Top Description Fields Constructors Methods
org.eclipse.persistence.tools.schemaframework

public Class StoredProcedureDefinition

extends DatabaseObjectDefinition
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.tools.schemaframework.StoredFunctionDefinition
Imports
java.io.IOException, .Writer, java.util.List, .Vector, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.internal.databaseaccess.DatabasePlatform, .FieldTypeDefinition, org.eclipse.persistence.internal.sessions.AbstractSession

Purpose: Allow a semi-generic way of creating stored procedures.

Field Summary

Modifier and TypeField and Description
protected List<FieldDefinition>
protected List<Integer>
protected static final Integer
protected static final Integer
protected static final Integer
protected List<String>
protected List<FieldDefinition>
Inherited from org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition:
namequalifier

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addArgument(String argumentName, Class<?> type)

The arguments are the names of the parameters to the procedure.

public void
addArgument(String argumentName, Class<?> type, int size)

The arguments are the names of the parameters to the procedure.

public void
addArgument(String argumentName, String typeName)

The arguments are the names of the parameters to the procedure.

public void
addArgument(FieldDefinition argument)

The arguments are the names of the parameters to the procedure.

public void
addInOutputArgument(String argumentName, Class<?> type)

The output arguments are used to get values back from the proc.

public void
addInOutputArgument(FieldDefinition argument)

The output arguments are used to get values back from the proc, such as cursors.

public void
addOutputArgument(String argumentName, Class<?> type)

The output arguments are used to get values back from the proc.

public void
addOutputArgument(String argumentName, Class<?> type, int size)

The output arguments are used to get values back from the proc.

public void
addOutputArgument(String argumentName, String typeName)

The output arguments are used to get values back from the proc, such as cursors.

public void
addOutputArgument(FieldDefinition argument)

The output arguments are used to get values back from the proc, such as cursors.

public void
addStatement(String statement)

The statements are the SQL lines of code in procedure.

public void
addVariable(String variableName, String typeName)

The variables are the names of the declared variables used in the procedure.

public void
addVariable(FieldDefinition variable)

The variables are the names of the declared variables used in the procedure.

public Writer
public Writer
public List<FieldDefinition>
getArguments()

The arguments are the names of the parameters to the procedure.

public List<Integer>
public String
public String
public int
public List<String>
getStatements()

The statements are the SQL lines of code in procedure.

public List<FieldDefinition>
getVariables()

The variables are the names of the declared variables used in the procedure.

protected void
printArgument(final FieldDefinition
Stored procedure argument.
argument
,
final Writer
Target writer where to write argument string.
writer
,
final AbstractSession
Current session context.
session
)

Print the argument and its type.

protected void
printInOutputArgument(final FieldDefinition
Stored procedure argument.
argument
,
final Writer
Target writer where to write argument string.
writer
,
final AbstractSession
Current session context.
session
)

Print the argument and its type.

protected void
printOutputArgument(final FieldDefinition
Stored procedure argument.
argument
,
final Writer
Target writer where to write argument string.
writer
,
final AbstractSession
Current session context.
session
)

Print the argument and its type.

protected void
printReturn(Writer writer, AbstractSession session)

Prints return for stored function, nothing to do for stored procedure

public void
setArguments(List<FieldDefinition> arguments)

The arguments are the field defs of the parameters names and types to the procedure.

public void
setStatements(List<String> statements)

The statements are the SQL lines of code in procedure.

public void
setVariables(List<FieldDefinition> variables)

The variables are the field defs of the declared variables used in the procedure.

Inherited from org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition:
buildVPDCreationFunctionWriterbuildVPDCreationPolicyWriterbuildVPDDeletionWriterclonecreateDatabaseSchemacreateDatabaseSchemaOnDatabasecreateObjectcreateOnDatabasedropDatabaseSchemadropDatabaseSchemaOnDatabasedropFromDatabasedropObjectgetDatabaseSchemagetFieldTypeDefinitiongetFieldTypeDefinitiongetFullNamegetNamegetQualifierhasDatabaseSchemapostCreateObjectpreDropObjectsetNamesetQualifiershouldCreateDatabaseSchemashouldCreateVPDCallstoString

Field Detail

argumentsback to summary
protected List<FieldDefinition> arguments
argumentTypesback to summary
protected List<Integer> argumentTypes
INback to summary
protected static final Integer IN
INOUTback to summary
protected static final Integer INOUT
OUTback to summary
protected static final Integer OUT
statementsback to summary
protected List<String> statements
variablesback to summary
protected List<FieldDefinition> variables

Constructor Detail

StoredProcedureDefinitionback to summary
public StoredProcedureDefinition()

Method Detail

addArgumentback to summary
public void addArgument(String argumentName, Class<?> type)

The arguments are the names of the parameters to the procedure.

addArgumentback to summary
public void addArgument(String argumentName, Class<?> type, int size)

The arguments are the names of the parameters to the procedure.

addArgumentback to summary
public void addArgument(String argumentName, String typeName)

The arguments are the names of the parameters to the procedure.

addArgumentback to summary
public void addArgument(FieldDefinition argument)

The arguments are the names of the parameters to the procedure.

addInOutputArgumentback to summary
public void addInOutputArgument(String argumentName, Class<?> type)

The output arguments are used to get values back from the proc.

addInOutputArgumentback to summary
public void addInOutputArgument(FieldDefinition argument)

The output arguments are used to get values back from the proc, such as cursors.

addOutputArgumentback to summary
public void addOutputArgument(String argumentName, Class<?> type)

The output arguments are used to get values back from the proc.

addOutputArgumentback to summary
public void addOutputArgument(String argumentName, Class<?> type, int size)

The output arguments are used to get values back from the proc.

addOutputArgumentback to summary
public void addOutputArgument(String argumentName, String typeName)

The output arguments are used to get values back from the proc, such as cursors.

addOutputArgumentback to summary
public void addOutputArgument(FieldDefinition argument)

The output arguments are used to get values back from the proc, such as cursors.

addStatementback to summary
public void addStatement(String statement)

The statements are the SQL lines of code in procedure.

addVariableback to summary
public void addVariable(String variableName, String typeName)

The variables are the names of the declared variables used in the procedure.

addVariableback to summary
public void addVariable(FieldDefinition variable)

The variables are the names of the declared variables used in the procedure.

buildCreationWriterback to summary
public Writer buildCreationWriter(AbstractSession session, Writer writer) throws ValidationException

Implements abstract org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.buildCreationWriter.

INTERNAL: Return the create table statement.

Annotations
@Override
buildDeletionWriterback to summary
public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException

Implements abstract org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.buildDeletionWriter.

INTERNAL: Return the drop table statement.

Annotations
@Override
getArgumentsback to summary
public List<FieldDefinition> getArguments()

The arguments are the names of the parameters to the procedure.

getArgumentTypesback to summary
public List<Integer> getArgumentTypes()
getCreationHeaderback to summary
public String getCreationHeader()
getDeletionHeaderback to summary
public String getDeletionHeader()
getFirstArgumentIndexback to summary
public int getFirstArgumentIndex()
getStatementsback to summary
public List<String> getStatements()

The statements are the SQL lines of code in procedure.

getVariablesback to summary
public List<FieldDefinition> getVariables()

The variables are the names of the declared variables used in the procedure.

printArgumentback to summary
protected void printArgument(final FieldDefinition argument, final Writer writer, final AbstractSession session) throws IOException

Print the argument and its type.

Parameters
argument:FieldDefinition

Stored procedure argument.

writer:Writer

Target writer where to write argument string.

session:AbstractSession

Current session context.

Exceptions
IOException:
When any IO problem occurs.
printInOutputArgumentback to summary
protected void printInOutputArgument(final FieldDefinition argument, final Writer writer, final AbstractSession session) throws ValidationException

Print the argument and its type.

Parameters
argument:FieldDefinition

Stored procedure argument.

writer:Writer

Target writer where to write argument string.

session:AbstractSession

Current session context.

Exceptions
ValidationException:
When invalid or inconsistent data were found.
printOutputArgumentback to summary
protected void printOutputArgument(final FieldDefinition argument, final Writer writer, final AbstractSession session) throws ValidationException

Print the argument and its type.

Parameters
argument:FieldDefinition

Stored procedure argument.

writer:Writer

Target writer where to write argument string.

session:AbstractSession

Current session context.

Exceptions
ValidationException:
When invalid or inconsistent data were found.
printReturnback to summary
protected void printReturn(Writer writer, AbstractSession session) throws ValidationException

Prints return for stored function, nothing to do for stored procedure

setArgumentsback to summary
public void setArguments(List<FieldDefinition> arguments)

The arguments are the field defs of the parameters names and types to the procedure.

setStatementsback to summary
public void setStatements(List<String> statements)

The statements are the SQL lines of code in procedure.

setVariablesback to summary
public void setVariables(List<FieldDefinition> variables)

The variables are the field defs of the declared variables used in the procedure.