-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathQueryInfo.java
More file actions
95 lines (68 loc) · 1.97 KB
/
QueryInfo.java
File metadata and controls
95 lines (68 loc) · 1.97 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
package co.aurasphere.gomorrasql.model;
import java.util.ArrayList;
import java.util.List;
/**
* Context wrapper for the parsed query.
*
* @author Donato Rimenti
*
*/
public class QueryInfo {
public enum QueryType {
SELECT, UPDATE, DELETE, INSERT, COMMIT, BEGIN_TRANSACTION, ROLLBACK;
}
private QueryType type;
private String tableName;
private final List<String> columnNames = new ArrayList<>();
private final List<String> columnAliases = new ArrayList<>();
private final List<String> values = new ArrayList<>();
private final List<WhereCondition> whereConditions = new ArrayList<>();
private final List<String> joinedTables = new ArrayList<>();
private final List<String> whereConditionsJoinOperators = new ArrayList<>();
public QueryType getType() {
return type;
}
public void setType(QueryType type) {
this.type = type;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public List<String> getColumnNames() {
return columnNames;
}
public List<String> getColumnAliases() {
return columnAliases;
}
public void addColumnName(String columnName) {
this.columnNames.add( columnName );
this.columnAliases.add( columnName );
}
public List<String> getValues() {
return values;
}
public void addValue(String value) {
this.values.add(value);
}
public List<WhereCondition> getWhereConditions() {
return whereConditions;
}
public void addWhereCondition(WhereCondition whereCondition) {
this.whereConditions.add(whereCondition);
}
public List<String> getJoinedTables() {
return joinedTables;
}
public void addJoinedTable(String joinedTable) {
this.joinedTables.add(joinedTable);
}
public List<String> getWhereConditionsJoinOperators() {
return whereConditionsJoinOperators;
}
public void addWhereConditionsJoinOperator(String whereConditionsJoinOperator) {
this.whereConditionsJoinOperators.add(whereConditionsJoinOperator);
}
}