diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-30 09:58:48 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-30 09:58:48 +0500 |
commit | d5ec75ecd3697e37782c9dd53998c889d5b9ef4d (patch) | |
tree | 22096d3869db469ad556a0e7aeaecd17ad02c6b6 /src/org/traccar/database | |
parent | e24b3588647fc1597f31b9bcd26ed9b7378f9f5b (diff) | |
download | traccar-server-d5ec75ecd3697e37782c9dd53998c889d5b9ef4d.tar.gz traccar-server-d5ec75ecd3697e37782c9dd53998c889d5b9ef4d.tar.bz2 traccar-server-d5ec75ecd3697e37782c9dd53998c889d5b9ef4d.zip |
Add API to get positions by Id
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index afa8b1677..8be53ad7b 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -280,6 +280,12 @@ public class DataManager { .executeQuery(Position.class); } + public Position getPosition(long positionId) throws SQLException { + return QueryBuilder.create(dataSource, getQuery("database.selectPosition")) + .setLong("id", positionId) + .executeQuerySingle(Position.class); + } + public void addPosition(Position position) throws SQLException { position.setId(QueryBuilder.create(dataSource, getQuery("database.insertPosition"), true) .setDate("now", new Date()) |