aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-01-25 20:31:32 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-01-26 08:41:45 +1300
commit346c6befe177c6cffe99e6ac9cc6083000a2981c (patch)
tree5763d82e52cf6c1a5b2c2d499245069bb5e431be /src/org/traccar/database
parent0f87445428a831e0f0d3b69f6f07f2a60272f2fb (diff)
downloadtraccar-server-346c6befe177c6cffe99e6ac9cc6083000a2981c.tar.gz
traccar-server-346c6befe177c6cffe99e6ac9cc6083000a2981c.tar.bz2
traccar-server-346c6befe177c6cffe99e6ac9cc6083000a2981c.zip
Some more code cleanup
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) {