Open hantsy opened 1 year ago
The current workaround is having bean-defining annotations on repositories. IIRC, there's no hook in CDI that would allow scanning for subtypes of a particular interface.
Spring Data Repositories are not regular CDI beans, as a developer, when we use this feature(repository as CDI beans) in WildFly like other none CDI components(such as EJB, Jaxrs Controllers, etc.), I hope it is enabled by default.
Spring Data itself already scanned the completed repository metadata, and CDI allow manually registering beans like this, Spring Boot can provide a property to enable/disable the CDI bean registration.
I remember there is an old issue about this topic, now Jakarta EE 10/CDI 4 is switched to use
annotated
discovery mode by default to scan beans.But Spring Data
Repository
still requires usingall
discovery mode (the default mode in the legacy CDI 1.x/2.x) to treat Spring DataRepository
as CDI beans in a Jakarta container, such as WildFly, Payara, Glassfish etc.