Class LoggingConnectionDecorator

    • Constructor Detail

      • LoggingConnectionDecorator

        public LoggingConnectionDecorator()
    • Method Detail

      • setPrettyPrint

        public void setPrettyPrint​(boolean prettyPrint)
        If set to true, pretty-print SQL by running it through SQLFormatter.prettyPrint(java.lang.Object). If false, don't pretty-print, and output SQL logs in a single line. Pretty-printed SQL can be easier for a human to read, but is harder to parse with tools like grep.
      • setPrettyPrintLineLength

        public void setPrettyPrintLineLength​(int length)
        The number of characters to print per line when pretty-printing of SQL is enabled. Defaults to 60 to provide some space for any ant-related characters on the left of a standard 80-character display.
      • getPrintParameters

        public boolean getPrintParameters()

        Whether parameter values will be printed in exception messages or in trace. This is different from trackParameters which controls whether OpenJPA will track parameters internally (visible while debugging and used in batching).

      • setPrintParameters

        public void setPrintParameters​(boolean printParameters)
      • setWarningAction

        public void setWarningAction​(java.lang.String warningAction)
        What to do with SQL warnings.
      • getWarningAction

        public java.lang.String getWarningAction()
        What to do with SQL warnings.
      • decorate

        public java.sql.Connection decorate​(java.sql.Connection conn)
                                     throws java.sql.SQLException
        Description copied from interface: ConnectionDecorator
        Decorate the given connection if desired.
        Specified by:
        decorate in interface ConnectionDecorator
        Throws:
        java.sql.SQLException