Alexandre De Bruyn
Alexandre De Bruyn

Reputation: 1

JaVers: Hibernate integration WITHOUT Spring

I'm currently working on a project for which we need to track changes to model objects. We would like to use JaVers for that, as it seems exactly what we need for. However, for some reason, the client forbids the use of Spring. Is it possible to integrate JaVers and Hibernate together, without Spring librairies ?

Thanks

Edit: Actually, the project use JPA 2 for persistence, with Hibernate implementation (JBOSS server)

Upvotes: 0

Views: 988

Answers (3)

Bartek Walacik
Bartek Walacik

Reputation: 3496

Luckily, JaVers Core doesn't depend on Spring nor Hibernate. There is no special Hibernate support in JaVers, but you can use JaVers directly, take a look at these examples:

http://javers.org/documentation/repository-examples/#commit-changes

http://javers.org/documentation/repository-configuration/#choose-javers-repository

Upvotes: 1

Carlos Cook
Carlos Cook

Reputation: 151

You're going to want to create a hibernate.xml file which housse just the hibernate configuration. Then you're going to want to load that configuration and use it to create a sessionFactory and from there you can create a session and do all that good stuff. Here's a link on how to get started:

https://www.javatpoint.com/steps-to-create-first-hibernate-application

Upvotes: 0

tsolakp
tsolakp

Reputation: 5948

Hibernate has nothing to do with Spring. All Spring provides is a helpful way to lookup and wire datasource to Hibernate, create/manage Hibernate sessions and transactions. Without spring you have to do all of it right in your code unless Javers can do it for you.

Upvotes: 0

Related Questions