/** * Converts a column alias to use the appropriate delimiters */ public String convertAlias(String alias) { if (!needsConversion(getIdentifierConfiguration())) { return alias; } String[] names = Normalizer.splitName(alias); if (names.length <= 1) { // Nothing to split return alias; } // Skip the the first name. It is the alias (T0, T1, etc.) for (int i = 1; i < names.length; i++) { names[i] = toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().toString(), names[i], true); } return joinNames(getIdentifierConfiguration().getDefaultIdentifierRule(), names); }
/** * Converts a column alias to use the appropriate delimiters */ public String convertAlias(String alias) { if (!needsConversion(getIdentifierConfiguration())) { return alias; } String[] names = Normalizer.splitName(alias); if (names.length <= 1) { // Nothing to split return alias; } // Skip the the first name. It is the alias (T0, T1, etc.) for (int i = 1; i < names.length; i++) { names[i] = toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().toString(), names[i], true); } return joinNames(getIdentifierConfiguration().getDefaultIdentifierRule(), names); }
/** * Converts a column alias to use the appropriate delimiters */ public String convertAlias(String alias) { if (!needsConversion(getIdentifierConfiguration())) { return alias; } String[] names = Normalizer.splitName(alias); if (names.length <= 1) { // Nothing to split return alias; } // Skip the the first name. It is the alias (T0, T1, etc.) for (int i = 1; i < names.length; i++) { names[i] = toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().toString(), names[i], true); } return joinNames(getIdentifierConfiguration().getDefaultIdentifierRule(), names); }
/** * Converts a column alias to use the appropriate delimiters */ public String convertAlias(String alias) { if (!needsConversion(getIdentifierConfiguration())) { return alias; } String[] names = Normalizer.splitName(alias); if (names.length <= 1) { // Nothing to split return alias; } // Skip the the first name. It is the alias (T0, T1, etc.) for (int i = 1; i < names.length; i++) { names[i] = toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().toString(), names[i], true); } return joinNames(getIdentifierConfiguration().getDefaultIdentifierRule(), names); }
/** * Converts the identifier to a format appropriate for the configuration using * the default naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ public String toDBName(String name, boolean delimit) { return toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().getName(), name, delimit); }
/** * Converts the identifier to a format appropriate for the configuration using * the default naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ public String toDBName(String name, boolean delimit) { return toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().getName(), name, delimit); }
/** * Converts the identifier to a format appropriate for the configuration using * the default naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ public String toDBName(String name, boolean delimit) { return toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().getName(), name, delimit); }
/** * Converts the identifier to a format appropriate for the configuration using * the default naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ public String toDBName(String name, boolean delimit) { return toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().getName(), name, delimit); }
/** * Converts the identifier to a format appropriate for the configuration using * the specified naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ private String toDBName(String rule, String name, boolean delimit) { if (name == null) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !Normalizer.isDelimited(name)) { return delimit(rule, name, true); } return convert(Normalizer.getNamingConfiguration(), rule, name); }
/** * Converts the identifier to a format appropriate for the configuration using * the specified naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ private String toDBName(String rule, String name, boolean delimit) { if (name == null) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !Normalizer.isDelimited(name)) { return delimit(rule, name, true); } return convert(Normalizer.getNamingConfiguration(), rule, name); }
/** * Converts the identifier to a format appropriate for the configuration using * the specified naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ private String toDBName(String rule, String name, boolean delimit) { if (name == null) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !Normalizer.isDelimited(name)) { return delimit(rule, name, true); } return convert(Normalizer.getNamingConfiguration(), rule, name); }
private int getMaxLen(String rule, DBIdentifier name, int maxLen) { IdentifierConfiguration config = getIdentifierConfiguration(); if (maxLen < 1) { IdentifierRule nrule = config.getIdentifierRule(rule); maxLen = nrule.getMaxLength(); } // Subtract delimiter length if name is delimited or will be delimited if (config.delimitAll() || name.isDelimited()) { maxLen = maxLen - (config.getLeadingDelimiter().length() + config.getTrailingDelimiter().length()); } return maxLen; }
/** * Converts the identifier to a format appropriate for the configuration using * the specified naming rule. * @param delimit If false, do not delimit. Otherwise, delimit if necessary. */ private String toDBName(String rule, String name, boolean delimit) { if (name == null) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !Normalizer.isDelimited(name)) { return delimit(rule, name, true); } return convert(Normalizer.getNamingConfiguration(), rule, name); }
private int getMaxLen(String rule, DBIdentifier name, int maxLen) { IdentifierConfiguration config = getIdentifierConfiguration(); if (maxLen < 1) { IdentifierRule nrule = config.getIdentifierRule(rule); maxLen = nrule.getMaxLength(); } // Subtract delimiter length if name is delimited or will be delimited if (config.delimitAll() || name.isDelimited()) { maxLen = maxLen - (config.getLeadingDelimiter().length() + config.getTrailingDelimiter().length()); } return maxLen; }
private int getMaxLen(String rule, DBIdentifier name, int maxLen) { IdentifierConfiguration config = getIdentifierConfiguration(); if (maxLen < 1) { IdentifierRule nrule = config.getIdentifierRule(rule); maxLen = nrule.getMaxLength(); } // Subtract delimiter length if name is delimited or will be delimited if (config.delimitAll() || name.isDelimited()) { maxLen = maxLen - (config.getLeadingDelimiter().length() + config.getTrailingDelimiter().length()); } return maxLen; }
private int getMaxLen(String rule, DBIdentifier name, int maxLen) { IdentifierConfiguration config = getIdentifierConfiguration(); if (maxLen < 1) { IdentifierRule nrule = config.getIdentifierRule(rule); maxLen = nrule.getMaxLength(); } // Subtract delimiter length if name is delimited or will be delimited if (config.delimitAll() || name.isDelimited()) { maxLen = maxLen - (config.getLeadingDelimiter().length() + config.getTrailingDelimiter().length()); } return maxLen; }
/** * Converts the name to a name which can be used within a SQL statement. Uses * the appropriate delimiters and separators. * @parm name a DBIdentifier * @param delimit If true, allows the name to be delimited, if necessary. * Otherwise, the identifier is not delimited. */ public String toDBName(DBIdentifier name, boolean delimit) { if (DBIdentifier.isNull(name)) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !name.isDelimited()) { return delimit(name, true); } String rule = name.getType().name(); if (name instanceof QualifiedDBIdentifier) { QualifiedDBIdentifier path = (QualifiedDBIdentifier)name; return convertFull(Normalizer.getNamingConfiguration(), rule, path.getName()); } return convert(Normalizer.getNamingConfiguration(), rule, name.getName()); }
/** * Converts the name to a name which can be used within a SQL statement. Uses * the appropriate delimiters and separators. * @parm name a DBIdentifier * @param delimit If true, allows the name to be delimited, if necessary. * Otherwise, the identifier is not delimited. */ public String toDBName(DBIdentifier name, boolean delimit) { if (DBIdentifier.isNull(name)) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !name.isDelimited()) { return delimit(name, true); } String rule = name.getType().name(); if (name instanceof QualifiedDBIdentifier) { QualifiedDBIdentifier path = (QualifiedDBIdentifier)name; return convertFull(Normalizer.getNamingConfiguration(), rule, path.getName()); } return convert(Normalizer.getNamingConfiguration(), rule, name.getName()); }
/** * Converts the name to a name which can be used within a SQL statement. Uses * the appropriate delimiters and separators. * @parm name a DBIdentifier * @param delimit If true, allows the name to be delimited, if necessary. * Otherwise, the identifier is not delimited. */ public String toDBName(DBIdentifier name, boolean delimit) { if (DBIdentifier.isNull(name)) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !name.isDelimited()) { return delimit(name, true); } String rule = name.getType().name(); if (name instanceof QualifiedDBIdentifier) { QualifiedDBIdentifier path = (QualifiedDBIdentifier)name; return convertFull(Normalizer.getNamingConfiguration(), rule, path.getName()); } return convert(Normalizer.getNamingConfiguration(), rule, name.getName()); }
/** * Converts the name to a name which can be used within a SQL statement. Uses * the appropriate delimiters and separators. * @parm name a DBIdentifier * @param delimit If true, allows the name to be delimited, if necessary. * Otherwise, the identifier is not delimited. */ public String toDBName(DBIdentifier name, boolean delimit) { if (DBIdentifier.isNull(name)) { return null; } if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && getIdentifierConfiguration().delimitAll() && !name.isDelimited()) { return delimit(name, true); } String rule = name.getType().name(); if (name instanceof QualifiedDBIdentifier) { QualifiedDBIdentifier path = (QualifiedDBIdentifier)name; return convertFull(Normalizer.getNamingConfiguration(), rule, path.getName()); } return convert(Normalizer.getNamingConfiguration(), rule, name.getName()); }