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
FieldsModifier and TypeFieldDescriptionprotected Vectorprotected Vectorprotected static final Integerprotected static final Integerprotected static final Integerprotected Vectorprotected VectorFields inherited from class org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
name, qualifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(String argumentName, Class type) The arguments are the names of the parameters to the procedure.voidaddArgument(String argumentName, Class type, int size) The arguments are the names of the parameters to the procedure.voidaddArgument(String argumentName, String typeName) The arguments are the names of the parameters to the procedure.voidaddArgument(FieldDefinition argument) The arguments are the names of the parameters to the procedure.voidaddInOutputArgument(String argumentName, Class type) The output arguments are used to get values back from the proc.voidaddInOutputArgument(FieldDefinition argument) The output arguments are used to get values back from the proc, such as cursors.voidaddOutputArgument(String argumentName, Class type) The output arguments are used to get values back from the proc.voidaddOutputArgument(String argumentName, Class type, int size) The output arguments are used to get values back from the proc.voidaddOutputArgument(String argumentName, String typeName) The output arguments are used to get values back from the proc, such as cursors.voidaddOutputArgument(FieldDefinition argument) The output arguments are used to get values back from the proc, such as cursors.voidaddStatement(String statement) The statements are the SQL lines of code in procedure.voidaddVariable(String variableName, String typeName) The variables are the names of the declared variables used in the procedure.voidaddVariable(FieldDefinition variable) The variables are the names of the declared variables used in the procedure.buildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) INTERNAL: Return the create table statement.buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) INTERNAL: Return the drop table statement.The arguments are the names of the parameters to the procedure.intThe statements are the SQL lines of code in procedure.The variables are the names of the declared variables used in the procedure.protected voidprintArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) Print the argument and its type.protected voidprintInOutputArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) Print the argument and its type.protected voidprintOutputArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) Print the argument and its type.protected voidprintReturn(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) Prints return for stored function, nothing to do for stored procedurevoidsetArguments(Vector arguments) The arguments are the field defs of the parameters names and types to the procedure.voidsetStatements(Vector statements) The statements are the SQL lines of code in procedure.voidsetVariables(Vector 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(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) throws ValidationException INTERNAL: Return the create table statement.- Specified by:
buildCreationWriterin classDatabaseObjectDefinition- Throws:
ValidationException
-
buildDeletionWriter
public Writer buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) throws ValidationException INTERNAL: Return the drop table statement.- Specified by:
buildDeletionWriterin 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, org.eclipse.persistence.internal.sessions.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, org.eclipse.persistence.internal.sessions.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, org.eclipse.persistence.internal.sessions.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
protected void printReturn(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) throws ValidationException 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.
-