org.jooq
Interface Parameter<T>

Type Parameters:
T - The parameter type
All Superinterfaces:
Adapter, Attachable, Comparable<NamedQueryPart>, NamedQueryPart, NamedTypeProviderQueryPart<T>, QueryPart, Serializable

public interface Parameter<T>
extends NamedTypeProviderQueryPart<T>

A parameter to a stored procedure or function.

Author:
Lukas Eder

Method Summary
 boolean isDefaulted()
          Whether this parameter has a default value Procedures and functions with defaulted parameters behave slightly different from ones without defaulted parameters.
 
Methods inherited from interface org.jooq.NamedTypeProviderQueryPart
getDataType, getDataType, getType
 
Methods inherited from interface org.jooq.NamedQueryPart
getName
 
Methods inherited from interface org.jooq.Attachable
attach
 
Methods inherited from interface org.jooq.Adapter
internalAPI
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

isDefaulted

boolean isDefaulted()
Whether this parameter has a default value

Procedures and functions with defaulted parameters behave slightly different from ones without defaulted parameters. In PL/SQL and other procedural languages, it is possible to pass parameters by name, reordering names and omitting defaulted parameters:

 CREATE PROCEDURE MY_PROCEDURE (P_DEFAULTED IN NUMBER := 0
                                P_MANDATORY IN NUMBER);

 -- The above procedure can be called as such:
 BEGIN
   -- Assign parameters by index
   MY_PROCEDURE(1, 2);

   -- Assign parameters by name
   MY_PROCEDURE(P_DEFAULTED => 1,
                P_MANDATORY => 2);

   -- Omitting defaulted parameters
   MY_PROCEDURE(P_MANDATORY => 2);
 END;
 

If a procedure has defaulted parameters, jOOQ binds them by name, rather than by index.

Currently, this is only supported for Oracle



Copyright © 2012. All Rights Reserved.