diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/storage/DatabaseStorage.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/storage/DatabaseStorage.java b/src/main/java/org/traccar/storage/DatabaseStorage.java index 34ae7c784..2b9172153 100644 --- a/src/main/java/org/traccar/storage/DatabaseStorage.java +++ b/src/main/java/org/traccar/storage/DatabaseStorage.java @@ -299,10 +299,11 @@ public class DatabaseStorage extends Storage { conditionKey = Permission.getKey(condition.getPropertyClass()); } + String storageName = Permission.getStorageName(condition.getOwnerClass(), condition.getPropertyClass()); result.append("SELECT "); - result.append(outputKey); + result.append(storageName).append('.').append(outputKey); result.append(" FROM "); - result.append(Permission.getStorageName(condition.getOwnerClass(), condition.getPropertyClass())); + result.append(storageName); result.append(" WHERE "); result.append(conditionKey); result.append(" = :"); @@ -323,7 +324,7 @@ public class DatabaseStorage extends Storage { result.append(" UNION "); result.append("SELECT DISTINCT "); - result.append(outputKey); + result.append(groupStorageName).append('.').append(outputKey); result.append(" FROM "); result.append(groupStorageName); |