Class HibernateSQLLogger

java.lang.Object
com.peterphi.std.guice.hibernate.module.logging.HibernateSQLLogger
All Implemented Interfaces:
Closeable, AutoCloseable, Consumer<String>

public class HibernateSQLLogger extends Object implements Closeable, AutoCloseable, Consumer<String>
Uses a Hibernate Interceptor to intercept SQL Statement preparations as they happen on the local thread
  • Constructor Details

  • Method Details

    • start

      public void start()
    • accept

      public void accept(String sql)
      Specified by:
      accept in interface Consumer<String>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getAllStatements

      public List<String> getAllStatements()
      Return a read-only copy of the statements prepared since this logger was started and before the logger was stopped; if the logger has not yet been stopped then it will return the statements prepared thus far
      Returns: