I would like to provide a library that adds JPA entities to the persistence context bootstrapped. Ideally I would like to achieve that without the user having to explicitly configure @EntityScan to include the package of that library solely by registering some auto configuration.
I've tried both @EntityScan on a configuration class and a BeanDefinitionRegistryPostProcessor to trigger EntityScanPackages.register(…) but EntityScanner will only apply the autoconfiguration package as fallback if no entity package is configured at all.
I can see that the semantics of @EntityScan are supposed to stay unchanged. I'd be fine with a programmatic approach, so maybe an explicit method EntityScanPackage.registerAdditional(…) could populate an additional list that EntityScanner adds on top of the defaulted base list?
I would like to provide a library that adds JPA entities to the persistence context bootstrapped. Ideally I would like to achieve that without the user having to explicitly configure
@EntityScanto include the package of that library solely by registering some auto configuration.I've tried both
@EntityScanon a configuration class and aBeanDefinitionRegistryPostProcessorto triggerEntityScanPackages.register(…)butEntityScannerwill only apply the autoconfiguration package as fallback if no entity package is configured at all.I can see that the semantics of
@EntityScanare supposed to stay unchanged. I'd be fine with a programmatic approach, so maybe an explicit methodEntityScanPackage.registerAdditional(…)could populate an additional list thatEntityScanneradds on top of the defaulted base list?