| 1 |
/* |
| 2 |
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 3 |
* and the EPL 1.0 (https://h2database.com/html/license.html). |
| 4 |
* Initial Developer: H2 Group |
| 5 |
*/ |
| 6 |
package org.h2.expression; |
| 7 |
|
| 8 |
import org.h2.message.DbException; |
| 9 |
import org.h2.value.TypeInfo; |
| 10 |
import org.h2.value.Value; |
| 11 |
|
| 12 |
/** |
| 13 |
* The interface for client side (remote) and server side parameters. |
| 14 |
*/ |
| 15 |
public interface ParameterInterface { |
| 16 |
|
| 17 |
/** |
| 18 |
* Set the value of the parameter. |
| 19 |
* |
| 20 |
* @param value the new value |
| 21 |
* @param closeOld if the old value (if one is set) should be closed |
| 22 |
*/ |
| 23 |
void setValue(Value value, boolean closeOld); |
| 24 |
|
| 25 |
/** |
| 26 |
* Get the value of the parameter if set. |
| 27 |
* |
| 28 |
* @return the value or null |
| 29 |
*/ |
| 30 |
Value getParamValue(); |
| 31 |
|
| 32 |
/** |
| 33 |
* Check if the value is set. |
| 34 |
* |
| 35 |
* @throws DbException if not set. |
| 36 |
*/ |
| 37 |
void checkSet() throws DbException; |
| 38 |
|
| 39 |
/** |
| 40 |
* Is the value of a parameter set. |
| 41 |
* |
| 42 |
* @return true if set |
| 43 |
*/ |
| 44 |
boolean isValueSet(); |
| 45 |
|
| 46 |
/** |
| 47 |
* Returns the expected data type if no value is set, or the |
| 48 |
* data type of the value if one is set. |
| 49 |
* |
| 50 |
* @return the data type |
| 51 |
*/ |
| 52 |
TypeInfo getType(); |
| 53 |
|
| 54 |
/** |
| 55 |
* Check if this column is nullable. |
| 56 |
* |
| 57 |
* @return Column.NULLABLE_* |
| 58 |
*/ |
| 59 |
int getNullable(); |
| 60 |
|
| 61 |
} |