If you are not using Spring, then you can configure the profiler directly by modifying the Hibernate configuration. The following properties should be set in your Hibernate configuration file:
<session-factory> ... <property name="cache.query_cache_factory"> hibernatingrhinos.hibernate.profiler.cache.ProfilerQueryCacheFactory </property> <property name="generate_statistics">true</property> </sessionFactory>
If you have defined the property jdbc.batch_size to a number greater than zero, then you should also define the following property:
<session-factory> ... <property name="jdbc.batch_size">50</property> <property name="jdbc.factory_class"> hibernatingrhinos.hibernate.profiler.jdbc.ProfilerBatchingBatcherFactory </property> </session-factory>