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/DataManager.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 1f6315d92..a997a89f6 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -242,12 +242,16 @@ public class DataManager {
public String getQuery(String action, Class<?> owner, Class<?> property) {
String queryName;
- if (action.equals(ACTION_SELECT_ALL)) {
- queryName = "database.select" + owner.getSimpleName() + property.getSimpleName() + "s";
- } else if (action.equals(ACTION_INSERT)) {
- queryName = "database.link" + owner.getSimpleName() + property.getSimpleName();
- } else {
- queryName = "database.unlink" + owner.getSimpleName() + property.getSimpleName();
+ switch (action) {
+ case ACTION_SELECT_ALL:
+ queryName = "database.select" + owner.getSimpleName() + property.getSimpleName() + "s";
+ break;
+ case ACTION_INSERT:
+ queryName = "database.link" + owner.getSimpleName() + property.getSimpleName();
+ break;
+ default:
+ queryName = "database.unlink" + owner.getSimpleName() + property.getSimpleName();
+ break;
}
String query = config.getString(queryName);
if (query == null) {