Fixing MySQL query parsing bug for IoTRelation; adjusting MySQL queries for new inter...
authorrtrimana <rtrimana@uci.edu>
Fri, 6 Jan 2017 17:02:26 +0000 (09:02 -0800)
committerrtrimana <rtrimana@uci.edu>
Fri, 6 Jan 2017 17:02:26 +0000 (09:02 -0800)
23 files changed:
iotjava/iotinstaller/TableRelation.java
localconfig/mysql/alarmSet.config
localconfig/mysql/audioRooms.config
localconfig/mysql/camSet.config
localconfig/mysql/cameraSet.config
localconfig/mysql/cameras.config
localconfig/mysql/gpsSet.config
localconfig/mysql/gwSet.config
localconfig/mysql/lawnCameraRelation.config
localconfig/mysql/lawnMoistureSensorRelation.config
localconfig/mysql/lawnSet.config
localconfig/mysql/lawnSprinklerRelation.config
localconfig/mysql/mainRoomLightBulbs.config
localconfig/mysql/moistureSensorsSet.config
localconfig/mysql/roomCameraRel.config
localconfig/mysql/roomMainBulbRel.config
localconfig/mysql/roomSensorRelation.config
localconfig/mysql/roomSet.config
localconfig/mysql/roomSpeakerRel.config
localconfig/mysql/rooms.config
localconfig/mysql/smartSensorsSet.config
localconfig/mysql/speakerSet.config
others/Mysql/IoTMain.gz

index 3b8f9ac..f6babbb 100644 (file)
@@ -207,7 +207,12 @@ public class TableRelation extends TableSet {
                                // Scan WHERE for either IoTSet or IoTRelation
                                if (strScan.equals("WHERE")) {
                                        // The next token is definitely the WHERE statement
-                                       strScan = scanFile.next();
+                                       strScan = "";
+                                       String strWhere = scanFile.next();
+                                       while (!strWhere.equals(";")) {
+                                               strScan = strScan + " " + strWhere;
+                                               strWhere = scanFile.next();
+                                       }
                                        this.setWhereCondition(strScan);
                                }
                        }
index 61a95ee..de84beb 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM
-Room
+RoomSmart
 WHERE
 TYPE='AudioRoom'
 ;
index 939eb25..5798c17 100644 (file)
@@ -1,3 +1,5 @@
 SELECT * FROM
-Camera
+CameraSmart
+WHERE
+ID='CM1'
 ;
index 7e16ba1..a061abc 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM\r
-Camera\r
+CameraSmart\r
 WHERE\r
 ID='CM1'\r
 ;\r
index cde5488..1059359 100644 (file)
@@ -1,3 +1,3 @@
 SELECT * FROM\r
-GPSGateway\r
+GPSGatewaySmart\r
 ;\r
index a506d4c..0dcca8c 100644 (file)
@@ -1,3 +1,3 @@
 SELECT * FROM\r
-WeatherGateway\r
+WeatherGatewaySmart\r
 ;\r
index 137a132..a7c9f33 100644 (file)
@@ -1,6 +1,6 @@
 SELECT RELATION FROM\r
 FIRST\r
-Lawn\r
+LawnSmart\r
 OTHER\r
-Camera\r
+CameraSmart\r
 ;\r
index 5a72f79..d441f4f 100644 (file)
@@ -1,6 +1,6 @@
 SELECT RELATION FROM\r
 FIRST\r
-Lawn\r
+LawnSmart\r
 OTHER\r
-MoistureSensor\r
+MoistureSensorSmart\r
 ;\r
index c507f89..58fb02e 100644 (file)
@@ -1,3 +1,3 @@
 SELECT * FROM\r
-Lawn\r
+LawnSmart\r
 ;\r
index 9be34c7..5da7318 100644 (file)
@@ -1,8 +1,8 @@
 SELECT RELATION FROM\r
 FIRST\r
-Lawn\r
+LawnSmart\r
 OTHER\r
-Sprinkler\r
+SprinklerSmart\r
 WHERE\r
-ID_DESTINATION='SP2'\r
+ID_DESTINATION='SP1'\r
 ;\r
index 3297815..231f2cd 100644 (file)
@@ -1,6 +1,8 @@
 SELECT RELATION FROM
 FIRST
-Room
+RoomSmart
 OTHER
-Camera
+CameraSmart
+WHERE
+TYPE_SOURCE LIKE 'LabRoom%' 
 ;
index 5f82a4b..1b94d14 100644 (file)
@@ -1,6 +1,8 @@
 SELECT RELATION FROM
 FIRST
-Room
+RoomSmart
 OTHER
-LightBulb
+LightBulbSmart
+WHERE
+TYPE_SOURCE LIKE 'LabRoom%' 
 ;
index 52a7dce..4ca1794 100644 (file)
@@ -1,6 +1,6 @@
 SELECT RELATION FROM
 FIRST
-Room
+RoomSmart
 OTHER
-SmartthingsSensor
+SmartthingsSensorSmart
 ;
index 6f5dc60..873a333 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM
-Room
+RoomSmart
 WHERE
 TYPE='HomeRoom'
 ;
index 3f88688..5f40cbd 100644 (file)
@@ -1,6 +1,6 @@
 SELECT RELATION FROM
 FIRST
-Room
+RoomSmart
 OTHER
-Speaker
+SpeakerSmart
 ;
index a085212..0749e75 100644 (file)
@@ -1,5 +1,5 @@
 SELECT * FROM
-Room
+RoomSmart
 WHERE
 TYPE='LabRoom'
 ;
index be13609..68774b6 100644 (file)
@@ -1,3 +1,3 @@
 SELECT * FROM
-SmartthingsSensor
+SmartthingsSensorSmart
 ;
index 7ebde92..2a8eacf 100644 (file)
@@ -1,3 +1,3 @@
 SELECT * FROM\r
-Speaker\r
+SpeakerSmart\r
 ;\r
index 0c9918c..1842ea2 100644 (file)
Binary files a/others/Mysql/IoTMain.gz and b/others/Mysql/IoTMain.gz differ