aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/storage
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-20 07:14:23 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-20 07:14:23 -0700
commit5afb5176c63e97b1a99ef54aa7af09927fb1f3f2 (patch)
treef84e584602b9190e028ae8c68f4d37bb528bdb7e /src/main/java/org/traccar/storage
parent45940f73c57b871711ee9fb41ebeba3c0ca9e9b6 (diff)
downloadtrackermap-server-5afb5176c63e97b1a99ef54aa7af09927fb1f3f2.tar.gz
trackermap-server-5afb5176c63e97b1a99ef54aa7af09927fb1f3f2.tar.bz2
trackermap-server-5afb5176c63e97b1a99ef54aa7af09927fb1f3f2.zip
Simplify select statements
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 052f11ad2..eec72b510 100644
--- a/src/main/java/org/traccar/storage/DatabaseStorage.java
+++ b/src/main/java/org/traccar/storage/DatabaseStorage.java
@@ -54,7 +54,11 @@ public class DatabaseStorage extends Storage {
@Override
public <T> List<T> getObjects(Class<T> clazz, Request request) throws StorageException {
StringBuilder query = new StringBuilder("SELECT ");
- query.append(formatColumns(request.getColumns(), clazz, "get", c -> c));
+ if (request.getColumns() instanceof Columns.All) {
+ query.append('*');
+ } else {
+ query.append(formatColumns(request.getColumns(), clazz, "get", c -> c));
+ }
query.append(" FROM ").append(getStorageName(clazz));
query.append(formatCondition(request.getCondition()));
query.append(formatOrder(request.getOrder()));