aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-31 14:08:36 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-31 15:17:59 +0500
commitae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6 (patch)
treead0679fac893b5000f1abfaeee9f4433b3596374 /src/org/traccar/api/resource
parentd3021c9ae11b177fe05b79e98f1e560e8c3cbaf5 (diff)
downloadtraccar-server-ae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6.tar.gz
traccar-server-ae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6.tar.bz2
traccar-server-ae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6.zip
Implement SQL requests construction
Diffstat (limited to 'src/org/traccar/api/resource')
-rw-r--r--src/org/traccar/api/resource/EventResource.java2
-rw-r--r--src/org/traccar/api/resource/PositionResource.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/api/resource/EventResource.java b/src/org/traccar/api/resource/EventResource.java
index b7fda6f73..a7cf9edbd 100644
--- a/src/org/traccar/api/resource/EventResource.java
+++ b/src/org/traccar/api/resource/EventResource.java
@@ -23,7 +23,7 @@ public class EventResource extends BaseResource {
@Path("{id}")
@GET
public Event get(@PathParam("id") long id) throws SQLException {
- Event event = Context.getDataManager().getEvent(id);
+ Event event = Context.getDataManager().getObject(Event.class, id);
Context.getPermissionsManager().checkDevice(getUserId(), event.getDeviceId());
if (event.getGeofenceId() != 0) {
Context.getPermissionsManager().checkPermission(Geofence.class, getUserId(), event.getGeofenceId());
diff --git a/src/org/traccar/api/resource/PositionResource.java b/src/org/traccar/api/resource/PositionResource.java
index 6dab51744..c031b842f 100644
--- a/src/org/traccar/api/resource/PositionResource.java
+++ b/src/org/traccar/api/resource/PositionResource.java
@@ -54,7 +54,7 @@ public class PositionResource extends BaseResource {
if (!positionIds.isEmpty()) {
ArrayList<Position> positions = new ArrayList<>();
for (Long positionId : positionIds) {
- Position position = Context.getDataManager().getPosition(positionId);
+ Position position = Context.getDataManager().getObject(Position.class, positionId);
Context.getPermissionsManager().checkDevice(getUserId(), position.getDeviceId());
positions.add(position);
}