Skip to content

Package: Parameter

Parameter

Coverage

1: /**
2: * Copyright (C) 2016 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.model.query;
16:
17: /**
18: * Type for query parameter objects.
19: *
20: * @param <T>
21: * the type of the parameter
22: */
23: public interface Parameter<T> {
24:         /**
25:          * Return the parameter name, or null if the parameter is not a named
26:          * parameter or no name has been assigned.
27:          *
28:          * @return parameter name
29:          */
30:         String getName();
31:
32:         /**
33:          * Return the parameter position, or null if the parameter is not a
34:          * positional parameter.
35:          *
36:          * @return position of parameter
37:          */
38:         Integer getPosition();
39:
40:         /**
41:          * Return the Java type of the parameter. Values bound to the parameter must
42:          * be assignable to this type. This method is required to be supported for
43:          * criteria queries only. Applications that use this method for Java
44:          * Persistence query language queries and native queries will not be
45:          * portable.
46:          *
47:          * @return the Java type of the parameter
48:          * @throws IllegalStateException
49:          * if invoked on a parameter
50:          *
51:          * obtained from a Java persistence query language
52:          *
53:          * query or native query when the implementation does
54:          *
55:          * not support this use
56:          */
57:         Class<T> getParameterType();
58: }