-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring-data-jpa-entity-graph is incompatible with spring-data-envers #180
Comments
There's a workaround.
or like this:
As explained here: |
Alternative, your can create two different repository and configure annotation @HistoryRepository
public interface MyEntityHistoryRepository extend RevisionRepository<MyEntity, Long, Long> {} and public interface MyEntityRepository extend JpaRepository<MyEntity, Long> {} configure JpaRepository @Configuration
@EnableJpaRepositories(excludeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = HistroyRepository.class))
public class JpaConfiguration {} configure EnversRepository @Configuration
@EnableEnversRepositories(includeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = HistroyRepository.class))
public class JpaHistoryConfiguration {} Or you can create custom repository factory bean like this |
What steps will reproduce the problem ?
Steps to reproduce the behavior:
What is the expected output ?
Spring context should start and the Envers repositories should work normally.
What happens instead ?
Spring context fails to start.
Environment
Additional context
The problem is @EnableEnversRepositories uses its own repositoryFactoryBeanClass that is EnversRevisionRepositoryFactoryBean and EntityGraphJpaRepositoryFactoryBean does not extend that one.
I can't create my own EnversRevisionRepositoryFactoryBean subclass adding the RepositoryEntityManagerEntityGraphInjector because it is package private.
Envers is a popular hibernate audit log implementation and spring-data-envers is a spring-data module to deal with envers in a spring-data way.
The text was updated successfully, but these errors were encountered: