aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debug.xml2
-rw-r--r--src/main/java/org/traccar/storage/DatabaseStorage.java6
2 files changed, 6 insertions, 2 deletions
diff --git a/debug.xml b/debug.xml
index 73576b20b..50e70c812 100644
--- a/debug.xml
+++ b/debug.xml
@@ -12,7 +12,7 @@
<entry key='web.console'>true</entry>
<entry key='logger.console'>true</entry>
- <entry key='logger.queries'>false</entry>
+ <entry key='logger.queries'>true</entry>
<entry key='database.driver'>org.h2.Driver</entry>
<entry key='database.url'>jdbc:h2:./target/database</entry>
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()));