aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DataManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-07-25 15:31:03 +1200
committerGitHub <noreply@github.com>2017-07-25 15:31:03 +1200
commit6253fa291c3a2962fef2076c0cbb0f4e1ca8a3b4 (patch)
tree8cba8784f507140e871e290229ab9841034a0c07 /src/org/traccar/database/DataManager.java
parentc8e5c5e3da63646fd7c84d4f522bc8d7e5109982 (diff)
parentf35961c2f4a3104a009d6e3cd6bc862e6810b998 (diff)
downloadtrackermap-server-6253fa291c3a2962fef2076c0cbb0f4e1ca8a3b4.tar.gz
trackermap-server-6253fa291c3a2962fef2076c0cbb0f4e1ca8a3b4.tar.bz2
trackermap-server-6253fa291c3a2962fef2076c0cbb0f4e1ca8a3b4.zip
Merge pull request #3385 from Abyss777/optimize_managers
Few managers optimizations
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r--src/org/traccar/database/DataManager.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 80b9f98e9..862efbc91 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -23,7 +23,6 @@ import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
-import java.util.Map;
import javax.naming.InitialContext;
import javax.sql.DataSource;
@@ -41,6 +40,7 @@ import org.traccar.helper.Log;
import org.traccar.model.AttributeAlias;
import org.traccar.model.Device;
import org.traccar.model.Event;
+import org.traccar.model.Permission;
import org.traccar.model.BaseModel;
import org.traccar.model.Position;
import org.traccar.model.Server;
@@ -293,10 +293,10 @@ public class DataManager {
return QueryBuilder.create(dataSource, getQuery(query)).executeQuery(clazz);
}
- public Collection<Map<String, Long>> getPermissions(Class<? extends BaseModel> owner,
- Class<? extends BaseModel> property) throws SQLException {
+ public Collection<Permission> getPermissions(Class<? extends BaseModel> owner,
+ Class<? extends BaseModel> property) throws SQLException, ClassNotFoundException {
String query = "database.select" + owner.getSimpleName() + property.getSimpleName() + "s";
- return QueryBuilder.create(dataSource, getQuery(query)).executeMapQuery(Long.class);
+ return QueryBuilder.create(dataSource, getQuery(query)).executePermissionsQuery();
}
public void addObject(BaseModel entity) throws SQLException {