-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathUnion.java
More file actions
48 lines (39 loc) · 1013 Bytes
/
Copy pathUnion.java
File metadata and controls
48 lines (39 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package jaskell.sql;
import jaskell.script.Directive;
import jaskell.script.Parameter;
import java.util.List;
public class Union extends Query implements ThenSelect {
Directive _prefix;
Directive _query;
public Union() {
}
public Union(Query query) {
this._query = query;
}
public All all(Query query) {
All re = new All();
re._prefix = this._prefix;
re._query = query;
return re;
}
@Override
public String script() {
if (_query == null) {
return String.format("%s UNION", _prefix.script());
} else {
return String.format("%s UNION %s", _prefix.script(), _query.script());
}
}
@Override
public List<Parameter<?>> parameters() {
List<Parameter<?>> re = _prefix.parameters();
re.addAll(_query.parameters());
return re;
}
public static class All extends Union implements ThenSelect {
@Override
public String script() {
return String.format("%s UNION ALL %s", _prefix.script(), _query.script());
}
}
}