Module org.eclipse.persistence.core
Class StoredProcedureDefinition
java.lang.Object
org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
StoredFunctionDefinition
Purpose: Allow a semi-generic way of creating stored procedures.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected List
<FieldDefinition> protected static final Integer
protected static final Integer
protected static final Integer
protected List
<FieldDefinition> Fields inherited from class org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
name, qualifier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addArgument
(String argumentName, Class<?> type) The arguments are the names of the parameters to the procedure.void
addArgument
(String argumentName, Class<?> type, int size) The arguments are the names of the parameters to the procedure.void
addArgument
(String argumentName, String typeName) The arguments are the names of the parameters to the procedure.void
addArgument
(FieldDefinition argument) The arguments are the names of the parameters to the procedure.void
addInOutputArgument
(String argumentName, Class<?> type) The output arguments are used to get values back from the proc.void
addInOutputArgument
(FieldDefinition argument) The output arguments are used to get values back from the proc, such as cursors.void
addOutputArgument
(String argumentName, Class<?> type) The output arguments are used to get values back from the proc.void
addOutputArgument
(String argumentName, Class<?> type, int size) The output arguments are used to get values back from the proc.void
addOutputArgument
(String argumentName, String typeName) The output arguments are used to get values back from the proc, such as cursors.void
addOutputArgument
(FieldDefinition argument) The output arguments are used to get values back from the proc, such as cursors.void
addStatement
(String statement) The statements are the SQL lines of code in procedure.void
addVariable
(String variableName, String typeName) The variables are the names of the declared variables used in the procedure.void
addVariable
(FieldDefinition variable) The variables are the names of the declared variables used in the procedure.buildCreationWriter
(AbstractSession session, Writer writer) INTERNAL: Return the create table statement.buildDeletionWriter
(AbstractSession session, Writer writer) INTERNAL: Return the drop table statement.The arguments are the names of the parameters to the procedure.int
The statements are the SQL lines of code in procedure.The variables are the names of the declared variables used in the procedure.protected void
printArgument
(FieldDefinition argument, Writer writer, AbstractSession session) Print the argument and its type.protected void
printInOutputArgument
(FieldDefinition argument, Writer writer, AbstractSession session) Print the argument and its type.protected void
printOutputArgument
(FieldDefinition argument, Writer writer, AbstractSession session) Print the argument and its type.protected void
printReturn
(Writer writer, AbstractSession session) Prints return for stored function, nothing to do for stored procedurevoid
setArguments
(List<FieldDefinition> arguments) The arguments are the field defs of the parameters names and types to the procedure.void
setStatements
(List<String> statements) The statements are the SQL lines of code in procedure.void
setVariables
(List<FieldDefinition> variables) The variables are the field defs of the declared variables used in the procedure.Methods inherited from class org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
buildVPDCreationFunctionWriter, buildVPDCreationPolicyWriter, buildVPDDeletionWriter, clone, createDatabaseSchema, createDatabaseSchemaOnDatabase, createObject, createOnDatabase, dropDatabaseSchema, dropDatabaseSchemaOnDatabase, dropFromDatabase, dropObject, getDatabaseSchema, getFieldTypeDefinition, getFieldTypeDefinition, getFullName, getName, getQualifier, hasDatabaseSchema, postCreateObject, preDropObject, setName, setQualifier, shouldCreateDatabaseSchema, shouldCreateVPDCalls, toString
-
Field Details
-
variables
-
statements
-
arguments
-
argumentTypes
-
IN
-
OUT
-
INOUT
-
-
Constructor Details
-
StoredProcedureDefinition
public StoredProcedureDefinition()
-
-
Method Details
-
addArgument
The arguments are the names of the parameters to the procedure. -
addArgument
The arguments are the names of the parameters to the procedure. -
addArgument
The arguments are the names of the parameters to the procedure. -
addArgument
The arguments are the names of the parameters to the procedure. -
addInOutputArgument
The output arguments are used to get values back from the proc. -
addInOutputArgument
The output arguments are used to get values back from the proc, such as cursors. -
addOutputArgument
The output arguments are used to get values back from the proc. -
addOutputArgument
The output arguments are used to get values back from the proc. -
addOutputArgument
The output arguments are used to get values back from the proc, such as cursors. -
addOutputArgument
The output arguments are used to get values back from the proc, such as cursors. -
addStatement
The statements are the SQL lines of code in procedure. -
addVariable
The variables are the names of the declared variables used in the procedure. -
addVariable
The variables are the names of the declared variables used in the procedure. -
buildCreationWriter
public Writer buildCreationWriter(AbstractSession session, Writer writer) throws ValidationException INTERNAL: Return the create table statement.- Specified by:
buildCreationWriter
in classDatabaseObjectDefinition
- Throws:
ValidationException
-
buildDeletionWriter
public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException INTERNAL: Return the drop table statement.- Specified by:
buildDeletionWriter
in classDatabaseObjectDefinition
- Throws:
ValidationException
-
getArguments
The arguments are the names of the parameters to the procedure. -
getCreationHeader
-
getDeletionHeader
-
getFirstArgumentIndex
public int getFirstArgumentIndex() -
getArgumentTypes
-
getStatements
The statements are the SQL lines of code in procedure. -
getVariables
The variables are the names of the declared variables used in the procedure. -
printArgument
protected void printArgument(FieldDefinition argument, Writer writer, AbstractSession session) throws IOException Print the argument and its type.- Parameters:
argument
- Stored procedure argument.writer
- Target writer where to write argument string.session
- Current session context.- Throws:
IOException
- When any IO problem occurs.
-
printInOutputArgument
protected void printInOutputArgument(FieldDefinition argument, Writer writer, AbstractSession session) throws ValidationException Print the argument and its type.- Parameters:
argument
- Stored procedure argument.writer
- Target writer where to write argument string.session
- Current session context.- Throws:
ValidationException
- When invalid or inconsistent data were found.
-
printOutputArgument
protected void printOutputArgument(FieldDefinition argument, Writer writer, AbstractSession session) throws ValidationException Print the argument and its type.- Parameters:
argument
- Stored procedure argument.writer
- Target writer where to write argument string.session
- Current session context.- Throws:
ValidationException
- When invalid or inconsistent data were found.
-
printReturn
Prints return for stored function, nothing to do for stored procedure- Throws:
ValidationException
-
setArguments
The arguments are the field defs of the parameters names and types to the procedure. -
setStatements
The statements are the SQL lines of code in procedure. -
setVariables
The variables are the field defs of the declared variables used in the procedure.
-