File tree Expand file tree Collapse file tree 4 files changed +41
-22
lines changed
src/main/java/org/mybatis/dynamic/sql/select Expand file tree Collapse file tree 4 files changed +41
-22
lines changed Original file line number Diff line number Diff line change 26
26
import org .mybatis .dynamic .sql .util .Buildable ;
27
27
28
28
public class MultiSelectDSL implements Buildable <MultiSelectModel > {
29
- private final List <MultiSelectModel . UnionQuery > unionQueries = new ArrayList <>();
29
+ private final List <UnionQuery > unionQueries = new ArrayList <>();
30
30
private final SelectModel initialSelect ;
31
31
private OrderByModel orderByModel ;
32
32
private Long limit ;
@@ -38,12 +38,12 @@ public MultiSelectDSL(Buildable<SelectModel> builder) {
38
38
}
39
39
40
40
public MultiSelectDSL union (Buildable <SelectModel > builder ) {
41
- unionQueries .add (new MultiSelectModel . UnionQuery ("union" , builder .build ())); //$NON-NLS-1$
41
+ unionQueries .add (new UnionQuery ("union" , builder .build ())); //$NON-NLS-1$
42
42
return this ;
43
43
}
44
44
45
45
public MultiSelectDSL unionAll (Buildable <SelectModel > builder ) {
46
- unionQueries .add (new MultiSelectModel . UnionQuery ("union all" , builder .build ())); //$NON-NLS-1$
46
+ unionQueries .add (new UnionQuery ("union all" , builder .build ())); //$NON-NLS-1$
47
47
return this ;
48
48
}
49
49
Original file line number Diff line number Diff line change @@ -101,22 +101,4 @@ public MultiSelectModel build() {
101
101
return new MultiSelectModel (this );
102
102
}
103
103
}
104
-
105
- public static class UnionQuery {
106
- private final String connector ;
107
- private final SelectModel selectModel ;
108
-
109
- public UnionQuery (String connector , SelectModel selectModel ) {
110
- this .connector = Objects .requireNonNull (connector );
111
- this .selectModel = Objects .requireNonNull (selectModel );
112
- }
113
-
114
- public String connector () {
115
- return connector ;
116
- }
117
-
118
- public SelectModel selectModel () {
119
- return selectModel ;
120
- }
121
- }
122
104
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2016-2023 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package org .mybatis .dynamic .sql .select ;
17
+
18
+ import java .util .Objects ;
19
+
20
+ public class UnionQuery {
21
+ private final String connector ;
22
+ private final SelectModel selectModel ;
23
+
24
+ public UnionQuery (String connector , SelectModel selectModel ) {
25
+ this .connector = Objects .requireNonNull (connector );
26
+ this .selectModel = Objects .requireNonNull (selectModel );
27
+ }
28
+
29
+ public String connector () {
30
+ return connector ;
31
+ }
32
+
33
+ public SelectModel selectModel () {
34
+ return selectModel ;
35
+ }
36
+ }
Original file line number Diff line number Diff line change 26
26
import org .mybatis .dynamic .sql .select .MultiSelectModel ;
27
27
import org .mybatis .dynamic .sql .select .PagingModel ;
28
28
import org .mybatis .dynamic .sql .select .SelectModel ;
29
+ import org .mybatis .dynamic .sql .select .UnionQuery ;
29
30
import org .mybatis .dynamic .sql .util .FragmentAndParameters ;
30
31
import org .mybatis .dynamic .sql .util .FragmentCollector ;
31
32
@@ -72,7 +73,7 @@ private FragmentAndParameters renderSelect(SelectModel selectModel) {
72
73
.build ();
73
74
}
74
75
75
- private FragmentAndParameters renderSelect (MultiSelectModel . UnionQuery unionQuery ) {
76
+ private FragmentAndParameters renderSelect (UnionQuery unionQuery ) {
76
77
SelectStatementProvider selectStatement = SelectRenderer .withSelectModel (unionQuery .selectModel ())
77
78
.withRenderingStrategy (renderingStrategy )
78
79
.withSequence (sequence )
You can’t perform that action at this time.
0 commit comments