-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathUsing.java
More file actions
61 lines (49 loc) · 1.4 KB
/
Copy pathUsing.java
File metadata and controls
61 lines (49 loc) · 1.4 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
package jaskell.sql;
import jaskell.script.Directive;
import jaskell.script.Parameter;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class Using implements Directive {
Directive _prefix;
List<Directive> _items;
Using(String names){
this._items = Arrays.stream(names.split(","))
.map(String::trim).map(Name::new).collect(Collectors.toList());;
}
Using(String ... names){
this._items = Arrays.stream(names).map(Name::new).collect(Collectors.toList());
}
Using(Directive... names){
this._items = Arrays.asList(names);
}
public Where where(Predicate predicate){
Where re = new Where(predicate);
re._from = this;
return re;
}
@Override
public String script() {
return String.format("%s USING(%s)",
_prefix.script(),
_items.stream().map(Directive::script).collect(Collectors.joining(",")));
}
@Override
public List<Parameter<?>> parameters() {
return null;
}
public static class Where extends Query {
Directive _from;
Predicate _predicate;
Where(Predicate predicate){
}
@Override
public String script() {
return null;
}
@Override
public List<Parameter<?>> parameters() {
return null;
}
}
}