From 58ae783a496355d76b533c11b23a203cdd59b9a7 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 28 Oct 2015 20:39:10 +0530 Subject: [PATCH] Fixing issues uncovered while running -Dsetup option with non-existent plugin based database scripts --- .../util/MobileDeviceManagementSchemaInitializer.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementSchemaInitializer.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementSchemaInitializer.java index 6af99b1e97..f0071a85f5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementSchemaInitializer.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementSchemaInitializer.java @@ -45,21 +45,18 @@ public final class MobileDeviceManagementSchemaInitializer extends DatabaseCreat return pluginType; } - public void setPluginType(String pluginType) { - this.pluginType = pluginType; - } - public MobileDeviceManagementSchemaInitializer(DataSource dataSource, String pType) { super(dataSource); this.pluginType = pType; } protected String getDbScriptLocation(String databaseType) { - String scriptName = databaseType + "_" + getPluginType() + ".sql"; + String scriptName = databaseType + ".sql"; + String scriptLocation = setupSQLScriptBaseLocation + this.getPluginType() + File.separator + scriptName; if (log.isDebugEnabled()) { - log.debug("Loading database script from :" + scriptName); + log.debug("Loading database script from :" + scriptLocation); } - return setupSQLScriptBaseLocation.replaceFirst("DBTYPE", databaseType) + scriptName; + return scriptLocation; } }