aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/QueryBuilder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java
index 9fb92a17f..cee27a413 100644
--- a/src/org/traccar/database/QueryBuilder.java
+++ b/src/org/traccar/database/QueryBuilder.java
@@ -36,6 +36,8 @@ import javax.json.Json;
import javax.json.JsonReader;
import javax.json.stream.JsonParsingException;
import javax.sql.DataSource;
+
+import org.traccar.Context;
import org.traccar.model.Factory;
import org.traccar.model.MiscFormatter;
@@ -250,7 +252,11 @@ public class QueryBuilder {
} else if (method.getReturnType().equals(Date.class)) {
setDate(name, (Date) method.invoke(object));
} else if (method.getReturnType().equals(Map.class)) {
- setString(name, MiscFormatter.toJsonString((Map) method.invoke(object)));
+ if (Context.getConfig().getBoolean("database.xml")) {
+ setString(name, MiscFormatter.toXmlString((Map) method.invoke(object)));
+ } else {
+ setString(name, MiscFormatter.toJsonString((Map) method.invoke(object)));
+ }
}
} catch (IllegalAccessException | InvocationTargetException error) {
}