Skip to content

spring-data-jpa-entity-graph is incompatible with spring-data-envers #180

@federicotg

Description

@federicotg

What steps will reproduce the problem ?

Steps to reproduce the behavior:

  1. Set up a project using envers using @EnableEnversRepositories
  2. Set repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class
  3. Spring context does not start: Error is Caused by: org.springframework.data.mapping. PropertyReferenceException: No property 'findRevisions' found for type 'CashCost'

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

  • Spring Data JPA version 3.2.3
  • ORM with version: Hibernate 6.4.4
  • spring-data-jpa-entity-graph version: 3.2.2
  • spring-data-envers 3.2.3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions