/** * Checks if a given identifier name needs to be quoted. It uses * generalized rules which are common across the majority of * databases. * * @param name * Identifier name to check * @return Whether the given name needs to be quoted */ public boolean isToBeQuoted(final String name) { if (name == null || name.isEmpty() || isQuotedName(name)) { return false; } switch (identifierQuotingStrategy) { case quote_none: return false; case quote_all: return true; case quote_if_special_characters: return !isIdentifier(name); case quote_if_special_characters_and_reserved_words: default: return !isIdentifier(name) || isReservedWord(name); } }
/** * Checks if a given identifier name needs to be quoted. It uses * generalized rules which are common across the majority of * databases. * * @param name * Identifier name to check * @return Whether the given name needs to be quoted */ public boolean isToBeQuoted(final String name) { if (name == null || name.isEmpty() || isQuotedName(name)) { return false; } switch (identifierQuotingStrategy) { case quote_none: return false; case quote_all: return true; case quote_if_special_characters: return !isIdentifier(name); case quote_if_special_characters_and_reserved_words: default: return !isIdentifier(name) || isReservedWord(name); } }
/** * Checks if a given identifier name needs to be quoted. It uses * generalized rules which are common across the majority of * databases. * * @param name * Identifier name to check * @return Whether the given name needs to be quoted */ public boolean isToBeQuoted(final String name) { if (name == null || name.isEmpty() || isQuotedName(name)) { return false; } switch (identifierQuotingStrategy) { case quote_none: return false; case quote_all: return true; case quote_if_special_characters: return !isIdentifier(name); case quote_if_special_characters_and_reserved_words: default: return !isIdentifier(name) || isReservedWord(name); } }
/** * Checks if a given identifier name needs to be quoted. It uses * generalized rules which are common across the majority of * databases. * * @param name * Identifier name to check * @return Whether the given name needs to be quoted */ public boolean isToBeQuoted(final String name) { if (name == null || name.isEmpty() || isQuotedName(name)) { return false; } switch (identifierQuotingStrategy) { case quote_none: return false; case quote_all: return true; case quote_if_special_characters: return !isIdentifier(name); case quote_if_special_characters_and_reserved_words: default: return !isIdentifier(name) || isReservedWord(name); } }