diff options
-rw-r--r-- | debug.xml | 2 | ||||
-rw-r--r-- | src/main/java/org/traccar/storage/DatabaseStorage.java | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -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())); |