How to enable or disable Hibernate