diff options
author | Renaud Allard <renaud@allard.it> | 2016-10-20 08:31:57 +0200 |
---|---|---|
committer | Renaud Allard <renaud@allard.it> | 2016-10-20 08:31:57 +0200 |
commit | 1104c2738e19579c5865db5c030388e1e320f0b4 (patch) | |
tree | a6571455b6f5d88581c8034bd1059968d506ed01 /src/org/traccar/database/DataManager.java | |
parent | 0d347cd7aac2ebfad01c1635f3893964be2e67ae (diff) | |
parent | 4f7356cc1c6962f46ca522246d5b63dc06a2d268 (diff) | |
download | trackermap-server-1104c2738e19579c5865db5c030388e1e320f0b4.tar.gz trackermap-server-1104c2738e19579c5865db5c030388e1e320f0b4.tar.bz2 trackermap-server-1104c2738e19579c5865db5c030388e1e320f0b4.zip |
Merge branch 'master' of https://github.com/tananaev/traccar
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 58d16d7f5..e98e1429c 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -20,7 +20,6 @@ import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.sql.SQLException; -import java.util.Calendar; import java.util.Collection; import java.util.Date; @@ -332,22 +331,14 @@ public class DataManager { .executeUpdate()); } - public Collection<Event> getEvents(long deviceId, String type, Date from, Date to) throws SQLException { + public Collection<Event> getEvents(long deviceId, Date from, Date to) throws SQLException { return QueryBuilder.create(dataSource, getQuery("database.selectEvents")) .setLong("deviceId", deviceId) - .setString("type", type) .setDate("from", from) .setDate("to", to) .executeQuery(Event.class); } - public Collection<Event> getLastEvents(long deviceId, String type, int interval) throws SQLException { - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.SECOND, -interval); - Date from = calendar.getTime(); - return getEvents(deviceId, type, from, new Date()); - } - public Collection<Geofence> getGeofences() throws SQLException { return QueryBuilder.create(dataSource, getQuery("database.selectGeofencesAll")) .executeQuery(Geofence.class); |