You mean like a org.hibernate.resource.jdbc.spi.StatementInspector?
On Wed, Jun 8, 2016 at 6:47 AM Vlad Mihalcea <mihalcea.vlad(a)gmail.com>
wrote:
Hi,
During testing, it's very useful to have an SQL query interceptor that we
can inspect to see if the generated SQL query contains a certain SQL
clause.
There are multiple ways we could implement this kind of feature:
1. We could add a public String[] getSQLQueries(); in the Statistics
interface.
2. We could define a SQLStatementInterceptor interface that can be provided
via some configuration property.
The SqlStatementLogger.logStatement could call the
SQLStatementInterceptor as well.
3. We could provide a way to provide a custom SQLStatementLogger class, so
that users can intercept statements via their custom SQLStatementLogger.
Currently, the only solution is to overwrite the sqlStatementLogger field
of the JdbcServicesImpl via Reflection, which is rather a hack.
What do you think?
Vlad
_______________________________________________
hibernate-dev mailing list
hibernate-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev