So in my persistence.xml
I turned on hibernate.generate_statistics
.
<property name="hibernate.generate_statistics">true</property>
My question is how do I access them? Where do the statistics go?
In your dao service you can go:
Session session = this.sessionFactory.getCurrentSession();
SessionStatistics sessionStats = session.getStatistics();
Statistics stats = this.sessionFactory.getStatistics();