To use Hibernatestatistics is required to create a Hibernate.cfg.xml?

Asked

Viewed 32 times

0

I found nonsense, since usually the settings of Hibernate are allocated in the xml persistence.

Can you recover the sessionfactory only using the settings of Hibernate allocated in persistence.xml ? or I need to replicate the configurations of ORM pro Hibernate.cfg.xml ?

1 answer

1


From JPA 2.1 you can recover the SessionFactory as follows:

SessionFactory sessionFactory = entityManagerFactory.unwrap(SessionFactory.class);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.