[#5276] Add ParamMode, an enum to specify if a parameter is IN, OUT, or INOUT

This commit is contained in:
lukaseder 2016-05-17 12:13:09 +02:00
parent 640b6f5cb6
commit 40e8e246e9
3 changed files with 77 additions and 0 deletions

View File

@ -125,4 +125,9 @@ public interface Param<T> extends Field<T> {
* The parameter type.
*/
ParamType getParamType();
/**
* The parameter mode.
*/
ParamMode getParamMode();
}

View File

@ -0,0 +1,66 @@
/**
* 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;
/**
* The mode of a {@link Param}.
*
* @author Lukas Eder
*/
public enum ParamMode {
/**
* An <code>IN</code> parameter.
* <p>
* This is the default parameter mode if no explicit mode was specified.
*/
IN,
/**
* An <code>OUT</code> parameter.
*/
OUT,
/**
* An <code>IN OUT</code> parameter.
*/
INOUT;
}

View File

@ -52,6 +52,7 @@ import org.jooq.Clause;
import org.jooq.Context;
import org.jooq.DataType;
import org.jooq.Param;
import org.jooq.ParamMode;
import org.jooq.UDTRecord;
import org.jooq.conf.ParamType;
import org.jooq.tools.StringUtils;
@ -170,4 +171,9 @@ abstract class AbstractParam<T> extends AbstractField<T> implements Param<T> {
: NAMED
;
}
@Override
public final ParamMode getParamMode() {
return ParamMode.IN;
}
}