Module eclipselink
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
public class StoredProcedureDefinition extends DatabaseObjectDefinition
Purpose: Allow a semi-generic way of creating stored procedures.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<FieldDefinition>argumentsprotected List<Integer>argumentTypesprotected List<String>characteristicsprotected static IntegerINprotected static IntegerINOUTprotected static IntegerOUTprotected List<String>statementsprotected List<FieldDefinition>variables-
Fields inherited from class org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
name, qualifier
-
-
Constructor Summary
Constructors Constructor Description StoredProcedureDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddArgument(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.voidaddCharacteristic(String characteristic)Add characteristic into the characteristics section of function/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.WriterbuildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)Deprecated, for removal: This API element is subject to removal in a future version.WriterbuildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)Deprecated, for removal: This API element is subject to removal in a future version.List<FieldDefinition>getArguments()The arguments are the names of the parameters to the procedure.List<Integer>getArgumentTypes()List<String>getCharacteristics()The characteristic section in procedure.StringgetCreationHeader()Deprecated, for removal: This API element is subject to removal in a future version.StringgetDeletionHeader()Deprecated, for removal: This API element is subject to removal in a future version.intgetFirstArgumentIndex()List<String>getStatements()The statements are the SQL lines of code in procedure.List<FieldDefinition>getVariables()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)Deprecated, for removal: This API element is subject to removal in a future version.protected voidprintInOutputArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session)Deprecated, for removal: This API element is subject to removal in a future version.protected voidprintOutputArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session)Deprecated, for removal: This API element is subject to removal in a future version.protected voidprintReturn(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session)Deprecated, for removal: This API element is subject to removal in a future version.voidsetArguments(List<FieldDefinition> arguments)The arguments are the field defs of the parameters names and types to the procedure.voidsetStatements(List<String> statements)The statements are the SQL lines of code in procedure.voidsetVariables(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 Detail
-
variables
protected List<FieldDefinition> variables
-
arguments
protected List<FieldDefinition> arguments
-
IN
protected static final Integer IN
-
OUT
protected static final Integer OUT
-
INOUT
protected static final Integer INOUT
-
-
Method Detail
-
addArgument
public void addArgument(String argumentName, Class<?> type)
The arguments are the names of the parameters to the procedure.
-
addArgument
public void addArgument(String argumentName, Class<?> type, int size)
The arguments are the names of the parameters to the procedure.
-
addArgument
public void addArgument(String argumentName, String typeName)
The arguments are the names of the parameters to the procedure.
-
addArgument
public void addArgument(FieldDefinition argument)
The arguments are the names of the parameters to the procedure.
-
addInOutputArgument
public void addInOutputArgument(String argumentName, Class<?> type)
The output arguments are used to get values back from the proc.
-
addInOutputArgument
public void addInOutputArgument(FieldDefinition argument)
The output arguments are used to get values back from the proc, such as cursors.
-
addOutputArgument
public void addOutputArgument(String argumentName, Class<?> type)
The output arguments are used to get values back from the proc.
-
addOutputArgument
public void addOutputArgument(String argumentName, Class<?> type, int size)
The output arguments are used to get values back from the proc.
-
addOutputArgument
public void addOutputArgument(String argumentName, String typeName)
The output arguments are used to get values back from the proc, such as cursors.
-
addOutputArgument
public void addOutputArgument(FieldDefinition argument)
The output arguments are used to get values back from the proc, such as cursors.
-
addStatement
public void addStatement(String statement)
The statements are the SQL lines of code in procedure.
-
addCharacteristic
public void addCharacteristic(String characteristic)
Add characteristic into the characteristics section of function/procedure.- Parameters:
characteristic- the function/procedure characteristic
-
addVariable
public void addVariable(String variableName, String typeName)
The variables are the names of the declared variables used in the procedure.
-
addVariable
public void addVariable(FieldDefinition variable)
The variables are the names of the declared variables used in the procedure.
-
buildCreationWriter
@Deprecated(forRemoval=true, since="4.0.9") public Writer buildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) throws ValidationException
Deprecated, for removal: This API element is subject to removal in a future version.INTERNAL: Return the create table statement.- Specified by:
buildCreationWriterin classDatabaseObjectDefinition- Throws:
ValidationException
-
buildDeletionWriter
@Deprecated(forRemoval=true, since="4.0.9") public Writer buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) throws ValidationException
Deprecated, for removal: This API element is subject to removal in a future version.INTERNAL: Return the drop table statement.- Specified by:
buildDeletionWriterin classDatabaseObjectDefinition- Throws:
ValidationException
-
getArguments
public List<FieldDefinition> getArguments()
The arguments are the names of the parameters to the procedure.
-
getCreationHeader
@Deprecated(forRemoval=true, since="4.0.9") public String getCreationHeader()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getDeletionHeader
@Deprecated(forRemoval=true, since="4.0.9") public String getDeletionHeader()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getFirstArgumentIndex
public int getFirstArgumentIndex()
-
getStatements
public List<String> getStatements()
The statements are the SQL lines of code in procedure.
-
getCharacteristics
public List<String> getCharacteristics()
The characteristic section in procedure. E.g.COMMENT <string>,DETERMINISTIC,MODIFIES SQL DATA,NO SQL, ... .
-
getVariables
public List<FieldDefinition> getVariables()
The variables are the names of the declared variables used in the procedure.
-
printArgument
@Deprecated(forRemoval=true, since="4.0.9") protected void printArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) throws IOException
Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true, since="4.0.9") protected void printInOutputArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) throws ValidationException
Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true, since="4.0.9") protected void printOutputArgument(FieldDefinition argument, Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) throws ValidationException
Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true, since="4.0.9") protected void printReturn(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) throws ValidationException
Deprecated, for removal: This API element is subject to removal in a future version.Prints return for stored function, nothing to do for stored procedure- Throws:
ValidationException
-
setArguments
public void setArguments(List<FieldDefinition> arguments)
The arguments are the field defs of the parameters names and types to the procedure.
-
setStatements
public void setStatements(List<String> statements)
The statements are the SQL lines of code in procedure.
-
setVariables
public void setVariables(List<FieldDefinition> variables)
The variables are the field defs of the declared variables used in the procedure.
-
-