diff options
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 7497294a1..39ffe6552 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -285,6 +285,14 @@ public class DataManager { return QueryBuilder.create(dataSource, getQuery(query)).executeQuery(clazz); } + public Collection<Map<String, Long>> getPermissions(String owner, String property) throws SQLException { + String query = "database.select" + + owner.substring(0, 1).toUpperCase() + owner.substring(1) + + property.substring(0, 1).toUpperCase() + property.substring(1) + + "s"; + return QueryBuilder.create(dataSource, getQuery(query)).executeMapQuery(Long.class); + } + public void addObject(BaseModel entity) throws SQLException { String query = "database.insert" + entity.getClass().getSimpleName(); entity.setId(QueryBuilder.create(dataSource, getQuery(query), true) |