aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler/events
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-13 10:31:54 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-13 10:31:54 -0700
commit4c8e98ed409df6e12128591eb1d8d0cf0856deb7 (patch)
tree83da3517bb14977ab4809aecf3681b777785e83d /src/main/java/org/traccar/handler/events
parentacedd28b8584a18022d9e2343558f9acbad1666f (diff)
downloadtrackermap-server-4c8e98ed409df6e12128591eb1d8d0cf0856deb7.tar.gz
trackermap-server-4c8e98ed409df6e12128591eb1d8d0cf0856deb7.tar.bz2
trackermap-server-4c8e98ed409df6e12128591eb1d8d0cf0856deb7.zip
Refactor database code (fix #4961)
Diffstat (limited to 'src/main/java/org/traccar/handler/events')
-rw-r--r--src/main/java/org/traccar/handler/events/GeofenceEventHandler.java3
-rw-r--r--src/main/java/org/traccar/handler/events/MotionEventHandler.java2
-rw-r--r--src/main/java/org/traccar/handler/events/OverspeedEventHandler.java2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java b/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
index b1be7e8ad..9414f4b31 100644
--- a/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
@@ -82,7 +82,8 @@ public class GeofenceEventHandler extends BaseEventHandler {
try {
storage.updateObject(device, new Request(
- new Columns.Include("geofenceIds"), new Condition.Equals("id", "id")));
+ new Columns.Include("geofenceIds"),
+ new Condition.Equals("id", device.getId())));
} catch (StorageException e) {
throw new RuntimeException("Update device geofences error", e);
}
diff --git a/src/main/java/org/traccar/handler/events/MotionEventHandler.java b/src/main/java/org/traccar/handler/events/MotionEventHandler.java
index 3511cf682..1b9763c41 100644
--- a/src/main/java/org/traccar/handler/events/MotionEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/MotionEventHandler.java
@@ -76,7 +76,7 @@ public class MotionEventHandler extends BaseEventHandler {
try {
storage.updateObject(device, new Request(
new Columns.Include("motionState", "motionTime", "motionDistance"),
- new Condition.Equals("id", "id")));
+ new Condition.Equals("id", device.getId())));
} catch (StorageException e) {
LOGGER.warn("Update device motion error", e);
}
diff --git a/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java b/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
index 3928fcc88..4d6aa8857 100644
--- a/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
@@ -113,7 +113,7 @@ public class OverspeedEventHandler extends BaseEventHandler {
try {
storage.updateObject(device, new Request(
new Columns.Include("overspeedState", "overspeedTime", "overspeedGeofenceId"),
- new Condition.Equals("id", "id")));
+ new Condition.Equals("id", device.getId())));
} catch (StorageException e) {
LOGGER.warn("Update device overspeed error", e);
}