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