diff options
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/Config.java | 2 | ||||
-rw-r--r-- | src/org/traccar/database/DataManager.java | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/org/traccar/Config.java b/src/org/traccar/Config.java index a0f3f8c2e..43f4632da 100644 --- a/src/org/traccar/Config.java +++ b/src/org/traccar/Config.java @@ -97,7 +97,7 @@ public class Config { } public void setString(String key, String value) { - properties.putIfAbsent(key, value); + properties.put(key, value); } } diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 3d89cc3d1..63d98818d 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -184,12 +184,12 @@ public class DataManager { + getPermissionsTableName(owner, property); case ACTION_INSERT: return "INSERT INTO " + getPermissionsTableName(owner, property) - + " (" + makeNameId(owner) + ", " + makeNameId(property) + ") VALUES (:" - + makeNameId(owner) + ", :" + makeNameId(property) + ")"; + + " (" + makeNameId(owner) + ", " + makeNameId(property) + ") VALUES (:" + + makeNameId(owner) + ", :" + makeNameId(property) + ")"; case ACTION_DELETE: return "DELETE FROM " + getPermissionsTableName(owner, property) - + " WHERE " + makeNameId(owner) + " = :" + makeNameId(owner) - + " AND " + makeNameId(property) + " = :" + makeNameId(property); + + " WHERE " + makeNameId(owner) + " = :" + makeNameId(owner) + + " AND " + makeNameId(property) + " = :" + makeNameId(property); default: throw new IllegalArgumentException("Unknown action"); } @@ -212,7 +212,10 @@ public class DataManager { if (action.equals(ACTION_SELECT_ALL)) { queryName = "database.select" + clazz.getSimpleName() + "s"; } else { - queryName = "database." + action.toLowerCase() + clazz.getSimpleName() + (extended ? "Extended" : ""); + queryName = "database." + action.toLowerCase() + clazz.getSimpleName(); + if (extended) { + queryName += "Extended"; + } } String query = config.getString(queryName); if (query == null) { |