Skip to content

JPA Autoconfigure to support ClasspathScanningPersistenceUnitPostProcessor #13339

@XhstormR

Description

@XhstormR

I use spring-boot-starter-data-jpa to configure JPA automatically. I saw ClasspathScanningPersistenceUnitPostProcessor in the reference for spring-data-jpa and I want to use it.

However, I found that using it must be manually configured LocalContainerEntityManagerFactoryBean, and so the automatic configuration of spring-boot-starter-data-jpa will not take effect.

It would be best if the following code configuration worked.

//Kotlin language

@Bean
open fun persistenceUnitPostProcessor(): ClasspathScanningPersistenceUnitPostProcessor {
    val persistenceUnitPostProcessor = ClasspathScanningPersistenceUnitPostProcessor("com.acme.domain")
    persistenceUnitPostProcessor.setMappingFileNamePattern("**/*Mapping.xml")
    return persistenceUnitPostProcessor
}

Sorry for my poor english.

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