spring-projects / spring-projects/spring-boot
Add include/exclude filters to @EntityScan
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Using @EntityScan lets Spring Boot scan all entities within one or more base packages to supply the discovered types to various Spring Data MappingContexts.
Initial entities in MappingContext can lead to various actions on component initialization (application startup) and there's currently no possibility to exclude entity types through filters. A common workaround is placing entities outside of the base packages that may or may not work, depending on the package structure.
It would be nice to have include/exclude filters (similar to @ComponentScan) for a fine-grained control of scanning.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the @EntityScan entry point and the MappingContext initialization described in the issue, then compare the requested behavior with @ComponentScan filters. Define how include and exclude filters should affect discovered entity types, and add coverage showing that filtered entities are or are not supplied to MappingContext instances.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100