Interface StatementInspector

All Superinterfaces:
Serializable
All Known Implementing Classes:
EmptyStatementInspector, SQLStatementInspector

public interface StatementInspector extends Serializable
Implementors may inspect and even process each SQL command issued by a session, before a JDBC statement is prepared. A StatementInspector may be either:
  • shared by all sessions created by a given session factory, in which case it must be thread-safe, or
  • a dedicated instance registered for a certain session.

An implementation may be specified via the configuration property "hibernate.session_factory.statement_inspector". An implementation registered this way is shared between sessions.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Inspect the given SQL command, possibly returning a different SQL command to be used instead.
  • Method Details

    • inspect

      String inspect(String sql)
      Inspect the given SQL command, possibly returning a different SQL command to be used instead. A null return value is interpreted as if the method had returned its argument.
      Parameters:
      sql - The SQL to inspect
      Returns:
      The processed SQL to use; may be null