diff options
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 8 |
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 { |