Don't do like that )
You need only two things:
- Add property to persistence.xml:
property name="hibernate.session_factory.statement_inspector" value="full-qualified class name"
- Write your listener class by implementing interface org.hibernate.resource.jdbc.spi.StatementInspector.
Profit!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…