Interface SqlIdentifierSanitizer

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SqlIdentifierSanitizer
Functional interface to sanitize SQL identifiers for SQL usage. Useful to guard SpEL expression results.
Since:
3.2
Author:
Kurt Niemi, Mark Paluch
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    sanitize(String sqlIdentifier)
    Sanitize a SQL identifier to either remove unwanted character sequences or to throw an exception.
    A sanitizer to allow words only.
  • Method Details

    • words

      static SqlIdentifierSanitizer words()
      A sanitizer to allow words only. Non-words are removed silently.
      Returns:
    • sanitize

      String sanitize(String sqlIdentifier)
      Sanitize a SQL identifier to either remove unwanted character sequences or to throw an exception.
      Parameters:
      sqlIdentifier - the identifier name.
      Returns:
      sanitized SQL identifier.