Skip to content

Package: Parameter

Parameter

Coverage

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