|
Author: doogie
Date: Thu Oct 7 20:46:33 2010 New Revision: 1005626 URL: http://svn.apache.org/viewvc?rev=1005626&view=rev Log: In getColumnInfo, getReferenceInfo, and getIndexInfo, replace all the blocks that fetched the scheme name with the helper method getSchemaName. Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java?rev=1005626&r1=1005625&r2=1005626&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java Thu Oct 7 20:46:33 2010 @@ -1165,16 +1165,8 @@ public class DatabaseUtil { if (Debug.infoOn()) Debug.logInfo("Getting Column Info From Database", module); Map<String, Map<String, ColumnCheckInfo>> colInfo = FastMap.newInstance(); - String lookupSchemaName = null; try { - if (dbData.supportsSchemasInTableDefinitions()) { - if (UtilValidate.isNotEmpty(this.datasourceInfo.schemaName)) { - lookupSchemaName = this.datasourceInfo.schemaName; - } else { - lookupSchemaName = dbData.getUserName(); - } - } - + String lookupSchemaName = getSchemaName(dbData); boolean needsUpperCase = false; try { needsUpperCase = dbData.storesLowerCaseIdentifiers() || dbData.storesMixedCaseIdentifiers(); @@ -1392,15 +1384,7 @@ public class DatabaseUtil { try { // ResultSet rsCols = dbData.getCrossReference(null, null, null, null, null, null); - String lookupSchemaName = null; - if (dbData.supportsSchemasInTableDefinitions()) { - if (UtilValidate.isNotEmpty(this.datasourceInfo.schemaName)) { - lookupSchemaName = this.datasourceInfo.schemaName; - } else { - lookupSchemaName = dbData.getUserName(); - } - } - + String lookupSchemaName = getSchemaName(dbData); boolean needsUpperCase = false; try { needsUpperCase = dbData.storesLowerCaseIdentifiers() || dbData.storesMixedCaseIdentifiers(); @@ -1533,14 +1517,7 @@ public class DatabaseUtil { Map<String, Set<String>> indexInfo = FastMap.newInstance(); try { int totalIndices = 0; - String lookupSchemaName = null; - if (dbData.supportsSchemasInTableDefinitions()) { - if (UtilValidate.isNotEmpty(this.datasourceInfo.schemaName)) { - lookupSchemaName = this.datasourceInfo.schemaName; - } else { - lookupSchemaName = dbData.getUserName(); - } - } + String lookupSchemaName = getSchemaName(dbData); for (String curTableName: tableNames) { if (lookupSchemaName != null) { curTableName = curTableName.substring(lookupSchemaName.length() + 1); |
| Free forum by Nabble | Edit this page |
