I am using spring boot and spring data jpa. I am also using hibernate envers and I need access to AuditReaderFactory so that I can write Audit Queries.
Since, its a spring boot and spring data jpa, everything is auto configured. So when I do this,
@Autowired
AuditReaderFactory auditReaderFactory;
It doesn't work. I get the following error.
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.hibernate.envers.AuditReaderFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency
How do I get a proper reference to AuditReaderFactory in my repository classes?