Skip to content

Package: CriteriaQueryHolder

CriteriaQueryHolder

nameinstructionbranchcomplexitylinemethod
CriteriaQueryHolder(Class)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getGroupBy()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getHaving()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getOrderBy()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getResultType()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getRoot()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getSelection()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getWhere()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isDistinct()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setDistinct(boolean)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setGroupBy(List)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setHaving(Predicate)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setOrderBy(List)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setRoot(Root)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setSelection(Selection)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setWhere(Predicate)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2022 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.criteria;
16:
17: import cz.cvut.kbss.jopa.model.query.criteria.*;
18: import java.util.List;
19:
20: public class CriteriaQueryHolder<T> {
21:
22: protected final Class<T> resultType;
23: protected Selection<? extends T> selection;
24: private boolean distinct;
25: protected Root<?> root;
26: protected Predicate where;
27: protected List<Order> orderBy;
28: protected List<Expression<?>> groupBy;
29: protected Predicate having;
30:
31: public CriteriaQueryHolder(Class<T> resultType) {
32: this.resultType = resultType;
33: this.distinct = false;
34: }
35:
36: public Class<T> getResultType() {
37: return resultType;
38: }
39:
40: public Predicate getHaving() {
41: return having;
42: }
43:
44: public void setHaving(Predicate having) {
45: this.having = having;
46: }
47:
48: public Root<?> getRoot() {
49: return root;
50: }
51:
52: public void setRoot(Root<?> root) {
53: this.root = root;
54: }
55:
56: public Predicate getWhere() {
57: return where;
58: }
59:
60: public void setWhere(Predicate where) {
61: this.where = where;
62: }
63:
64: public List<Expression<?>> getGroupBy() {
65: return groupBy;
66: }
67:
68: public void setGroupBy(List<Expression<?>> groupBy) {
69: this.groupBy = groupBy;
70: }
71:
72: public List<Order> getOrderBy() {
73: return orderBy;
74: }
75:
76: public void setOrderBy(List<Order> orderBy) {
77: this.orderBy = orderBy;
78: }
79:
80: public Selection<? extends T> getSelection() {
81: return selection;
82: }
83:
84: public void setSelection(Selection<? extends T> selection) {
85: this.selection = selection;
86: }
87:
88: public boolean isDistinct() {
89: return distinct;
90: }
91:
92: public void setDistinct(boolean distinct) {
93: this.distinct = distinct;
94: }
95:
96: }