The code snippet you showed is what you need. Just use your existing configuration instead of creating a new one.
If it is not you who instantiates the configuration (but, for example, spring), you’d need to extend the class that creates it.
More Related Contents:
- Mapping many-to-many association table with extra column(s)
- Hibernate: Difference between session.get and session.load
- Hibernate: one-to-one lazy loading, optional = false
- How to use Spring managed Hibernate interceptors in Spring Boot?
- What is the difference between DAO and Repository patterns?
- @OrderColumn annotation in Hibernate 3.5
- How to query data for Primefaces dataTable using lazy loading and pagination
- Hibernate Search: How to use wildcards correctly?
- Performing Date/Time Math In HQL?
- How to connect to multiple databases in Hibernate
- Spring Boot & Spring Data: how are Hibernate Sessions managed?
- Hibernate – why use many-to-one to represent a one-to-one?
- how to return Map with HQL
- Spring Data JPA – Pass column name and value as parameters
- hibernate could not get next sequence value
- Invalidating JPA EntityManager session
- How to generate a ddl creation script with a modern Spring Boot + Data JPA and Hibernate setup?
- Grails 2.4 and hibernate4 errors with run-app
- Hibernate/JPA ManyToOne vs OneToMany
- When to Use EntityManager.clear()?
- How is Hibernate deciding order of update/insert/delete
- Hibernate inserts duplicates into a @OneToMany collection
- What is the right way to use spring MVC with Hibernate in DAO, service layer architecture
- hibernate – get id after save object
- How to use JPA2’s @Cacheable instead of Hibernate’s @Cache
- Hibernate 3.6 – session.get() vs session.load()
- createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus
- CDI injection in EntityListeners
- UnsupportedOperationException: The application must supply JDBC connections
- New object with HQL