aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/storage
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/storage')
-rw-r--r--src/main/java/org/traccar/storage/DatabaseStorage.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/storage/DatabaseStorage.java b/src/main/java/org/traccar/storage/DatabaseStorage.java
index e8966be8e..cd82448e1 100644
--- a/src/main/java/org/traccar/storage/DatabaseStorage.java
+++ b/src/main/java/org/traccar/storage/DatabaseStorage.java
@@ -128,9 +128,13 @@ public class DatabaseStorage extends Storage {
conditions.add(new Condition.Equals(
Permission.getKey(propertyClass), Permission.getKey(propertyClass), propertyId));
}
- query.append(formatCondition(Condition.merge(conditions)));
+ Condition combinedCondition = Condition.merge(conditions);
+ query.append(formatCondition(combinedCondition));
try {
QueryBuilder builder = QueryBuilder.create(dataSource, query.toString());
+ for (Map.Entry<String, Object> variable : getConditionVariables(combinedCondition).entrySet()) {
+ builder.setValue(variable.getKey(), variable.getValue());
+ }
return builder.executePermissionsQuery();
} catch (SQLException e) {
throw new StorageException(e);