Skip to content

@EnableJpaRepositories(repositoryBaseClass = ...) doesn't support dependency injection #3384

Closed as not planned
@SledgeHammer01

Description

@SledgeHammer01

I have a configuration class that specifies a custom repo implementation:

@Configuration
@EnableJpaRepositories(
    basePackages = "xxx",
    entityManagerFactoryRef = "xxx",
    repositoryBaseClass = CustomRepositoryImpl.class,
    transactionManagerRef = "xxx")

This forces a constructor signature of:

  public CustomRepositoryImpl(
      JpaEntityInformation<T, ID> entityInformation, EntityManager entityManager)

And does not support @Autowired or any method I could find to pass in beans.

Can this be modified to instantiate the class via IOC to support pulling in beans?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions