org.jooq.Parameter Maven / Gradle / Ivy
Show all versions of payment-retries-plugin Show documentation
/*
* Copyright (c) 2009-2016, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
/**
* A parameter to a stored procedure or function.
*
* @param The parameter type
* @author Lukas Eder
*/
public interface Parameter extends QueryPart {
/**
* The name of this parameter
*/
String getName();
/**
* The Java type of the parameter.
*/
Class getType();
/**
* The parameter's underlying {@link Converter}.
*
* By default, all parameters reference an identity-converter
* Converter<T, T>
. Custom data types may be obtained by a
* custom {@link Converter} placed on the generated {@link Parameter}.
*/
Converter, T> getConverter();
/**
* The parameter's underlying {@link Binding}.
*/
Binding, T> getBinding();
/**
* The type of this parameter (might not be dialect-specific)
*/
DataType getDataType();
/**
* The dialect-specific type of this parameter
*/
DataType getDataType(Configuration configuration);
/**
* 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 11g
*/
boolean isDefaulted();
/**
* Whether this parameter has a name or not.
*
* Some databases (e.g. {@link SQLDialect#POSTGRES}) allow for using unnamed
* parameters. In this case, {@link #getName()} will return a synthetic name
* created from the parameter index.
*/
boolean isUnnamed();
}