spring-projects / spring-projects/spring-boot

Add include/exclude filters to @EntityScan

Open
#12,828 7 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.