/** * Convert backticks to the platform specific open quote and close quote * <p> * Specific plugins may implement this method to cater for platform specific * naming rules. * </p> * * @param dbName the db name * @return the string */ public String convertQuotedIdentifiers(String dbName) { // Ignore null values e.g. schema name or catalog if (dbName != null && !dbName.isEmpty()) { if (dbName.charAt(0) == BACK_TICK) { if (dbName.charAt(dbName.length() - 1) == BACK_TICK) { String quotedName = getOpenQuote(); quotedName += dbName.substring(1, dbName.length() - 1); quotedName += getCloseQuote(); return quotedName; } else { logger.error("Missing backquote on [" + dbName + "]"); } } } return dbName; }
/** * Convert backticks to the platform specific open quote and close quote * * <p>Specific plugins may implement this method to cater for * platform specific naming rules. * </p> * * @param dbName the db name * * @return the string */ public String convertQuotedIdentifiers(String dbName) { // Ignore null values e.g. schema name or catalog if (dbName != null && dbName.length() > 0){ if (dbName.charAt(0) == BACK_TICK) { if (dbName.charAt(dbName.length() - 1) == BACK_TICK) { String quotedName = getOpenQuote(); quotedName += dbName.substring(1, dbName.length() - 1); quotedName += getCloseQuote(); return quotedName; } else { logger.log(Level.SEVERE, "Missing backquote on [" + dbName + "]"); } } } return dbName; }
/** * Convert backticks to the platform specific open quote and close quote * * <p> * Specific plugins may implement this method to cater for platform specific * naming rules. * </p> * * @param dbName * the db name * * @return the string */ public String convertQuotedIdentifiers(String dbName) { // Ignore null values e.g. schema name or catalog if (dbName != null && dbName.length() > 0) { if (dbName.charAt(0) == BACK_TICK) { if (dbName.charAt(dbName.length() - 1) == BACK_TICK) { String quotedName = getOpenQuote(); quotedName += dbName.substring(1, dbName.length() - 1); quotedName += getCloseQuote(); return quotedName; } else { logger.log(Level.SEVERE, "Missing backquote on [" + dbName + "]"); } } } return dbName; }
/** * Strips off the Database Platform specific quoted identifier characters. */ public String removeQuotes(String dbColumn) { dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getOpenQuote(), ""); dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getCloseQuote(), ""); return dbColumn; } }
/** * Strips off the Database Platform specific quoted identifier characters. */ public String removeQuotes(String dbColumn) { dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getOpenQuote(), ""); dbColumn = StringHelper.replaceString(dbColumn, dbPlatform.getCloseQuote(), ""); return dbColumn; } }