aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/database/DataManager.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 63d98818d..709d2f057 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -72,6 +72,8 @@ public class DataManager {
private DataSource dataSource;
+ private boolean generateQueries;
+
public DataManager(Config config) throws Exception {
this.config = config;
@@ -120,6 +122,8 @@ public class DataManager {
hikariConfig.setMaximumPoolSize(maxPoolSize);
}
+ generateQueries = config.getBoolean("database.generateQueries");
+
dataSource = new HikariDataSource(hikariConfig);
}
@@ -218,9 +222,11 @@ public class DataManager {
}
}
String query = config.getString(queryName);
- if (query == null) {
+ if (query == null && generateQueries) {
query = constructObjectQuery(action, clazz, extended);
config.setString(queryName, query);
+ } else {
+ Log.info("Query not provided: " + queryName);
}
return query;
@@ -236,9 +242,11 @@ public class DataManager {
queryName = "database.unlink" + owner.getSimpleName() + property.getSimpleName();
}
String query = config.getString(queryName);
- if (query == null) {
+ if (query == null && generateQueries) {
query = constructPermissionQuery(action, owner, property.equals(User.class) ? ManagedUser.class : property);
config.setString(queryName, query);
+ } else {
+ Log.info("Query not provided: " + queryName);
}
return query;