Currently I have implemented a repository layer based on
HibernateDaoSupport. I create a
SessionFactory by using Spring's
AnnotationSessionFactoryBean. How do I get
Spring Data repositories working in this environment?
You have to replace
AnnotationSessionFactoryBean with the
LocalContainerEntityManagerFactoryBean.
Supposed you have registered it under
entityManagerFactory you can reference it in you
repositories based on HibernateDaoSupport as
follows:
Example C.1. Looking up a SessionFactory from an
HibernateEntityManagerFactory
I want to use Spring Data JPA auditing capabilities but have
my database already set up to set modification and creation date on
entities. How to prevent Spring Data from setting the date
programmatically.
Just use the set-dates attribute of the
auditing namespace element to false.