aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database/DataManager.java
diff options
context:
space:
mode:
authorsoshial <soshial@gmail.com>2021-09-12 09:31:38 +0200
committersoshial <soshial@gmail.com>2021-09-12 09:31:38 +0200
commit7a3b106dfc28a6254825b8d664db8181f4bd19f1 (patch)
tree3380489441a1d7bef077a2bd5a898ebde0ede168 /src/main/java/org/traccar/database/DataManager.java
parentd9ad81991da306dcae35bb6b7ba7f90c6d6b8725 (diff)
downloadtrackermap-server-7a3b106dfc28a6254825b8d664db8181f4bd19f1.tar.gz
trackermap-server-7a3b106dfc28a6254825b8d664db8181f4bd19f1.tar.bz2
trackermap-server-7a3b106dfc28a6254825b8d664db8181f4bd19f1.zip
improve naming and comments
Diffstat (limited to 'src/main/java/org/traccar/database/DataManager.java')
-rw-r--r--src/main/java/org/traccar/database/DataManager.java16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/main/java/org/traccar/database/DataManager.java b/src/main/java/org/traccar/database/DataManager.java
index 3f702f78a..d8401774e 100644
--- a/src/main/java/org/traccar/database/DataManager.java
+++ b/src/main/java/org/traccar/database/DataManager.java
@@ -340,20 +340,8 @@ public class DataManager {
}
}
- public Position getPrevPosition(long deviceId, Date date) throws SQLException {
- Collection<Position> positions = QueryBuilder.create(dataSource, getQuery("database.selectPrevPosition"))
- .setLong("deviceId", deviceId)
- .setDate("time", date)
- .executeQuery(Position.class);
- if (positions.isEmpty()) {
- return null;
- } else {
- return positions.iterator().next();
- }
- }
-
- public Position getNextPosition(long deviceId, Date date) throws SQLException {
- Collection<Position> positions = QueryBuilder.create(dataSource, getQuery("database.selectNextPosition"))
+ public Position getPrecedingPosition(long deviceId, Date date) throws SQLException {
+ Collection<Position> positions = QueryBuilder.create(dataSource, getQuery("database.selectPrecedingPosition"))
.setLong("deviceId", deviceId)
.setDate("time", date)
.executeQuery(Position.class);