aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-13 18:15:42 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-13 18:15:42 +1200
commitcd86a9e571f64a945e037e054e39d61c59798152 (patch)
tree71eb5bba0b7cc68396ecdc8d08861bc3614f4ff2
parent408758d371eaeb2ce25c1e8214f591200e741aaf (diff)
downloadtrackermap-server-cd86a9e571f64a945e037e054e39d61c59798152.tar.gz
trackermap-server-cd86a9e571f64a945e037e054e39d61c59798152.tar.bz2
trackermap-server-cd86a9e571f64a945e037e054e39d61c59798152.zip
Fix database data mocks
-rw-r--r--debug.xml2
-rw-r--r--src/org/traccar/database/DataManager.java9
2 files changed, 7 insertions, 4 deletions
diff --git a/debug.xml b/debug.xml
index 7b0cf0724..799f6aa92 100644
--- a/debug.xml
+++ b/debug.xml
@@ -9,7 +9,7 @@
<entry key='web.enable'>true</entry>
<!--<entry key='web.address'></entry>-->
<entry key='web.port'>8082</entry>
- <entry key='web.application'>../traccar-web/traccar-web.war</entry>
+ <!--<entry key='web.application'>../traccar-web/traccar-web.war</entry>-->
<entry key='web.new'>true</entry>
<entry key='web.path'>web</entry>
<entry key='web.mobile'>webm</entry>
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 4b9aacbbf..ef9e2a31a 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -168,9 +168,9 @@ public class DataManager {
admin.setEmail("admin");
admin.setPassword("admin");
admin.setAdmin(true);
- QueryBuilder.create(dataSource, properties.getProperty("database.insertUser"))
+ admin.setId(QueryBuilder.create(dataSource, properties.getProperty("database.insertUser"))
.setObject(admin)
- .executeUpdate();
+ .executeUpdate());
Server server = new Server();
server.setRegistration(true);
@@ -189,7 +189,10 @@ public class DataManager {
device.setName("test1");
device.setUniqueId("123456789012345");
addDevice(device);
- linkDevice(userId, device.getId());
+ QueryBuilder.create(dataSource, properties.getProperty("database.linkDevice"))
+ .setLong("userId", userId)
+ .setLong("deviceId", device.getId())
+ .executeUpdate();
Position position = new Position();
position.setDeviceId(device.getId());