forked from JSQLParser/JSqlParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExcludeConstraint.java
More file actions
97 lines (78 loc) · 2.62 KB
/
ExcludeConstraint.java
File metadata and controls
97 lines (78 loc) · 2.62 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*-
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2019 JSQLParser
* %%
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
* #L%
*/
package net.sf.jsqlparser.statement.create.table;
import java.util.Collection;
import java.util.List;
import net.sf.jsqlparser.expression.Expression;
public class ExcludeConstraint extends Index {
private Expression expression;
public Expression getExpression() {
return expression;
}
public void setExpression(Expression expression) {
this.expression = expression;
}
@Override
public String toString() {
StringBuilder exclusionStatement = new StringBuilder("EXCLUDE WHERE ");
exclusionStatement.append("(");
exclusionStatement.append(expression);
exclusionStatement.append(")");
return exclusionStatement.toString();
}
public ExcludeConstraint withExpression(Expression expression) {
this.setExpression(expression);
return this;
}
public <E extends Expression> E getExpression(Class<E> type) {
return type.cast(getExpression());
}
@Override
public ExcludeConstraint withName(List<String> name) {
return (ExcludeConstraint) super.withName(name);
}
@Override
public ExcludeConstraint withType(String type) {
return (ExcludeConstraint) super.withType(type);
}
@Override
public ExcludeConstraint withUsing(String using) {
return (ExcludeConstraint) super.withUsing(using);
}
@Override
public ExcludeConstraint withColumnsNames(List<String> list) {
return (ExcludeConstraint) super.withColumnsNames(list);
}
@Override
public ExcludeConstraint withColumns(List<ColumnParams> columns) {
return (ExcludeConstraint) super.withColumns(columns);
}
@Override
public ExcludeConstraint addColumns(ColumnParams... functionDeclarationParts) {
return (ExcludeConstraint) super.addColumns(functionDeclarationParts);
}
@Override
public ExcludeConstraint addColumns(
Collection<? extends ColumnParams> functionDeclarationParts) {
return (ExcludeConstraint) super.addColumns(functionDeclarationParts);
}
@Override
public ExcludeConstraint withIndexSpec(List<String> idxSpec) {
return (ExcludeConstraint) super.withIndexSpec(idxSpec);
}
@Override
public ExcludeConstraint withName(String name) {
return (ExcludeConstraint) super.withName(name);
}
@Override
public ExcludeConstraint withIndexKeyword(String indexKeyword) {
return (ExcludeConstraint) super.withIndexKeyword(indexKeyword);
}
}