Skip to content

Package: SoqlConstants$Functions

SoqlConstants$Functions

nameinstructionbranchcomplexitylinemethod
SoqlConstants.Functions()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (C) 2023 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.query.soql;
16:
17: /**
18: * Constants of the Semantic Object Query Language (SOQL).
19: */
20: public class SoqlConstants {
21:
22: /**
23: * {@code SELECT} keyword.
24: */
25: public static final String SELECT = "SELECT";
26:
27: /**
28: * {@code DISTINCT} operator.
29: */
30: public static final String DISTINCT = "DISTINCT";
31:
32: /**
33: * {@code FROM} keyword.
34: */
35: public static final String FROM = "FROM";
36:
37: /**
38: * {@code WHERE} keyword.
39: */
40: public static final String WHERE = "WHERE";
41:
42: /**
43: * {@code IN} operator.
44: */
45: public static final String IN = "IN";
46:
47: /**
48: * {@code NOT} operator.
49: */
50: public static final String NOT = "NOT";
51:
52: /**
53: * {@code GROUP BY} statement.
54: */
55: public static final String GROUP_BY = "GROUP BY";
56:
57: /**
58: * {@code ORDER BY} statement.
59: */
60: public static final String ORDER_BY = "ORDER BY";
61:
62: /**
63: * {@code ASC} keyword.
64: */
65: public static final String ASC = "ASC";
66:
67: /**
68: * {@code DESC} keyword.
69: */
70: public static final String DESC = "DESC";
71:
72: /**
73: * SPARQL shortcut for {@code rdf:type} - {@code a}.
74: */
75: public static final String RDF_TYPE = "a";
76:
77: /**
78: * SOQL variable prefix.
79: * <p>
80: * Same as in JPQL.
81: */
82: public static final char VARIABLE_PREFIX = ':';
83:
84: /**
85: * Supported SOQL functions.
86: */
87: public static class Functions {
88:
89: /**
90: * Takes an argument string and transforms it to lower case.
91: */
92: public static final String LOWER = "LOWER";
93:
94: /**
95: * Takes an argument string and transforms it to upper case.
96: */
97: public static final String UPPER = "UPPER";
98:
99: /**
100: * Counts the number of elements.
101: */
102: public static final String COUNT = "COUNT";
103:
104: /**
105: * Returns the length of a string.
106: */
107: public static final String LENGTH = "LENGTH";
108:
109: /**
110: * Returns the absolute value of the argument.
111: */
112: public static final String ABS = "ABS";
113:
114: /**
115: * Returns the smallest number with no fractional part that is not less than the argument.
116: */
117: public static final String CEIL = "CEIL";
118:
119: /**
120: * Returns the largest number with no fractional part that is not greater than the argument.
121: */
122: public static final String FLOOR = "FLOOR";
123:
124: private Functions() {
125: throw new AssertionError();
126: }
127: }
128:
129: private SoqlConstants() {
130: throw new AssertionError();
131: }
132: }