- All Superinterfaces:
Attachable
,Named
,Qualified
,QueryPart
,Serializable
- All Known Implementing Classes:
AbstractRoutine
A routine is a callable object in your RDBMS.
Callable objects are mainly stored procedures and stored functions. The distinction between those two object types is very subtle and not well defined across various RDBMS. In general, this can be said:
Procedures:
- Are called as callable statements
- Have no return value
- Support OUT parameters
- Can be used in SQL statements
- Have a return value
- Don't support OUT parameters
- DB2, H2, and HSQLDB don't allow for JDBC escape syntax when calling functions. Functions must be used in a SELECT statement
- H2 only knows functions (without OUT parameters)
- Oracle functions may have OUT parameters
- Oracle knows functions that mustn't be used in SQL statements
- Oracle parameters can have default values (to support this, jOOQ renders PL/SQL instead of the JDBC escape syntax)
- Postgres only knows functions (with all features combined)
- The Sybase JDBC driver doesn't handle null values correctly when using the JDBC escape syntax on functions
- etc...
Hence, with #852, jOOQ 1.6.8, the distinction between procedures and functions becomes obsolete. All stored routines are simply referred to as "Routine".
Instances of this type cannot be created directly. They are available from generated code.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptionint
execute()
Execute the stored object on an underlying connectionint
execute(Configuration configuration)
Execute the stored object using aConfiguration
object<Z> Z
A list of IN parameters passed to the stored procedure as argument.<Z> Z
getInValue(Parameter<Z> parameter)
A list of OUT parameters passed to the stored procedure as argument.@Nullable Package
The container package of this stored procedure or function.@NotNull Results
The parameter representing this routine'sgetReturnValue()
<Z> Z
<Z> void
Set the routine's IN value for an IN parameter.<Z> void
Set the routine's IN value for an IN parameter.Methods inherited from interface org.jooq.Attachable
attach, configuration, detach
Methods inherited from interface org.jooq.Named
getComment, getCommentPart, getName, getQualifiedName, getUnqualifiedName
Methods inherited from interface org.jooq.Qualified
getCatalog, getSchema
-
Method Details
-
getPackage
The container package of this stored procedure or function.This is only supported in the
SQLDialect.ORACLE
dialect.- Returns:
- The container package of this object, or
null
if there is no such container.
-
getReturnParameter
The parameter representing this routine'sgetReturnValue()
- Returns:
- The return parameter or
null
if this routine doesn't have a return value. - See Also:
getParameters()
-
getOutParameters
A list of OUT parameters passed to the stored procedure as argument. This list contains all parameters that are either OUT or INOUT in their respective order of appearance ingetParameters()
.- Returns:
- The list of out parameters
- See Also:
getParameters()
-
getInParameters
A list of IN parameters passed to the stored procedure as argument. This list contains all parameters that are either IN or INOUT in their respective order of appearance ingetParameters()
.- Returns:
- The list of in parameters
- See Also:
getParameters()
-
getParameters
- Returns:
- A list of parameters passed to the stored object as argument
-
execute
Execute the stored object using aConfiguration
object- Throws:
DataAccessException
- if something went wrong executing the query
-
execute
Execute the stored object on an underlying connection- Throws:
DataAccessException
- if something went wrong executing the query
-
setValue
Set the routine's IN value for an IN parameter. -
set
Set the routine's IN value for an IN parameter. -
getValue
- Returns:
- The routine's OUT value for an OUT parameter.
-
getInValue
- Returns:
- The routine's IN value for an IN parameter.
-
get
- Returns:
- The routine's OUT value for an OUT parameter.
-
getReturnValue
- Returns:
- The routine's return value (if it is a function)
-
getResults
- Returns:
- The routine's results (if available)
-