-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathThenSelect.java
More file actions
78 lines (63 loc) · 1.67 KB
/
Copy pathThenSelect.java
File metadata and controls
78 lines (63 loc) · 1.67 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package jaskell.sql;
import jaskell.script.Directive;
import jaskell.script.Parameter;
import java.util.List;
public interface ThenSelect extends Directive {
default Select select(){
Select re = new Select();
re._prefix = this;
return re;
}
default Select select(String names) {
Select re = new Select(names);
re._prefix = this;
return re;
}
default Select select(String... names) {
Select re = new Select(names);
re._prefix = this;
return re;
}
default Select select(Directive... names) {
Select re = new Select(names);
re._prefix = this;
return re;
}
class Select extends jaskell.sql.Select {
Directive _prefix;
Select(){
super();
}
Select(String names){
super(names);
}
Select(String ... names){
super(names);
}
Select(Directive... names){
super(names);
}
@Override
public String script() {
return String.format("%s %s", _prefix.script(), super.script());
}
@Override
public List<Parameter<?>> parameters() {
List<Parameter<?>> re = _prefix.parameters();
re.addAll(super.parameters());
return re;
}
public From from(String name){
From re = new From();
re._from = new Name(name);
re._select = this;
return re;
}
public From from(Directive f) {
From re = new From();
re._select = this;
re._from = f;
return re;
}
}
}