diff options
author | Abyss777 <abyss@fox5.ru> | 2017-07-21 18:41:49 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-07-21 18:41:49 +0500 |
commit | 69c46399ee0f6b3dd2b0589cb412e9e17f040369 (patch) | |
tree | 4d838e7c52df78acaae804eaa08911825edc0acd /src/org/traccar/database/ExtendedObjectManager.java | |
parent | 55d91ec7a86777bb0427422c15c2b8a60aa00071 (diff) | |
download | trackermap-server-69c46399ee0f6b3dd2b0589cb412e9e17f040369.tar.gz trackermap-server-69c46399ee0f6b3dd2b0589cb412e9e17f040369.tar.bz2 trackermap-server-69c46399ee0f6b3dd2b0589cb412e9e17f040369.zip |
Use classes instead of constants everywhere
Diffstat (limited to 'src/org/traccar/database/ExtendedObjectManager.java')
-rw-r--r-- | src/org/traccar/database/ExtendedObjectManager.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/org/traccar/database/ExtendedObjectManager.java b/src/org/traccar/database/ExtendedObjectManager.java index fce32fb41..8380b9da2 100644 --- a/src/org/traccar/database/ExtendedObjectManager.java +++ b/src/org/traccar/database/ExtendedObjectManager.java @@ -26,6 +26,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.traccar.Context; import org.traccar.helper.Log; import org.traccar.model.Device; +import org.traccar.model.Group; import org.traccar.model.BaseModel; public abstract class ExtendedObjectManager extends SimpleObjectManager { @@ -79,23 +80,26 @@ public abstract class ExtendedObjectManager extends SimpleObjectManager { try { Collection<Map<String, Long>> databaseGroupPermissions = - getDataManager().getPermissions("Group", getBaseClassName()); + getDataManager().getPermissions(Group.class, getBaseClass()); clearGroupItems(); for (Map<String, Long> groupPermission : databaseGroupPermissions) { - getGroupItems(groupPermission.get("groupId")).add(groupPermission.get(getBaseClassIdName())); + getGroupItems(groupPermission.get(DataManager.makeNameId(Group.class))) + .add(groupPermission.get(getBaseClassIdName())); } Collection<Map<String, Long>> databaseDevicePermissions = - getDataManager().getPermissions("Device", getBaseClassName()); + getDataManager().getPermissions(Device.class, getBaseClass()); Collection<Device> allDevices = Context.getDeviceManager().getAllDevices(); clearDeviceItems(); deviceItemsWithGroups.clear(); for (Map<String, Long> devicePermission : databaseDevicePermissions) { - getDeviceItems(devicePermission.get("deviceId")).add(devicePermission.get(getBaseClassIdName())); - getAllDeviceItems(devicePermission.get("deviceId")).add(devicePermission.get(getBaseClassIdName())); + getDeviceItems(devicePermission.get(DataManager.makeNameId(Device.class))) + .add(devicePermission.get(getBaseClassIdName())); + getAllDeviceItems(devicePermission.get(DataManager.makeNameId(Device.class))) + .add(devicePermission.get(getBaseClassIdName())); } for (Device device : allDevices) { |