|
4 | 4 | import Utility.DBUtil;
|
5 | 5 | import DataImport.FileParser;
|
6 | 6 |
|
| 7 | +import java.util.ArrayList; |
7 | 8 | import java.util.HashMap;
|
8 | 9 | import java.util.List;
|
9 | 10 | import java.util.Map;
|
|
12 | 13 | * Created by liuche on 6/5/17.
|
13 | 14 | */
|
14 | 15 | public class Execution {
|
15 |
| - private ResultTable resultTable; |
16 |
| - private Plan plan; |
17 |
| - private DBUtil dbUtil; |
| 16 | + protected ResultTable resultTable; |
| 17 | + protected Plan plan; |
| 18 | + protected int operandCount = 0; |
| 19 | + protected DBUtil dbUtil; |
| 20 | + protected List<String> querySQL = new ArrayList<>(); |
18 | 21 |
|
19 | 22 | public Execution(DBUtil util, Plan plan){
|
20 | 23 | this.dbUtil = util;
|
21 | 24 | this.resultTable = new ResultTable();
|
22 | 25 | this.plan = plan;
|
23 | 26 | }
|
24 | 27 |
|
| 28 | + public int operandCount(){ |
| 29 | + return operandCount(); |
| 30 | + } |
| 31 | + |
| 32 | + public List<String> getQuerySQL(){ |
| 33 | + return this.querySQL; |
| 34 | + } |
| 35 | + |
25 | 36 | public ResultTable execute(){
|
26 | 37 | return resultTable;
|
27 | 38 | }
|
28 | 39 |
|
29 |
| - private List<String> getAllNodeGid(){ |
| 40 | + public ResultTable execute(ResultTable table1){ |
| 41 | + return resultTable; |
| 42 | + } |
| 43 | + |
| 44 | + public ResultTable execute(ResultTable table1, ResultTable table2){ |
| 45 | + return resultTable; |
| 46 | + } |
| 47 | + |
| 48 | + protected List<String> getAllNodeGid(){ |
30 | 49 | String statement = "SELECT COUNT(*) FROM ObjectType WHERE type != \"0\";";
|
31 | 50 | return dbUtil.getListFromSQL(statement);
|
32 | 51 | }
|
33 | 52 |
|
34 |
| - private List<String> getNodeGidBy(String field, String value){ |
| 53 | + protected List<String> getNodeGidBy(String field, String value){ |
35 | 54 | String statement = "SELECT gid FROM P_" + field + "WHERE " + field + " = \"" + value + "\";";
|
36 | 55 | return dbUtil.getListFromSQL(statement);
|
37 | 56 | }
|
38 | 57 |
|
39 |
| - private List<String> getEdgeIdByFromGid(String node1){ |
| 58 | + protected List<String> getEdgeIdByFromGid(String node1){ |
40 | 59 | String statement = "SELECT eid FROM Edge WHERE node1 = \"" + node1 + "\";";
|
41 | 60 | return dbUtil.getListFromSQL(statement);
|
42 | 61 | }
|
43 | 62 |
|
44 |
| - private List<String> getEdgeIdByToGid(String node1){ |
| 63 | + protected List<String> getEdgeIdByToGid(String node1){ |
45 | 64 | String statement = "SELECT eid FROM Edge WHERE node2 = \"" + node1 + "\";";
|
46 | 65 | return dbUtil.getListFromSQL(statement);
|
47 | 66 | }
|
48 | 67 |
|
49 |
| - private Map<String, String> expandEdge(String eid){ |
| 68 | + protected Map<String, String> expandEdge(String eid){ |
50 | 69 | String statement = "SELECT * FROM edge WHERE eid = \"" + eid + "\";";
|
51 | 70 | return dbUtil.getObjectFromSQL(statement);
|
52 | 71 | }
|
53 | 72 |
|
54 |
| - private Map<String, String> expandObject(Integer gid){ |
| 73 | + protected Map<String, String> expandObject(Integer gid){ |
55 | 74 | String statement = "SELECT type FROM ObjectType WHERE gid = \"" + gid.toString() + "\";";
|
56 | 75 | Integer nodeType = dbUtil.getIntegerFromSQL(statement);
|
57 | 76 | statement = "SELECT name FROM typeProperty WHERE id = \"" + nodeType.toString() + "\";";
|
|
0 commit comments