All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jooq.Parameter Maven / Gradle / Ivy

The newest version!
/*
 * 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 getConverter(); /** * The parameter's underlying {@link Binding}. */ Binding 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(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy