Skip to content

Doc: MutablePersistenceUnitInfo.addManagedPackage() not triggering a package scan [SPR-12821] #17418

@spring-projects-issues

Description

@spring-projects-issues

Filipe Leandro opened SPR-12821 and commented

When using the PersistenceUnitPostProcessor interface for dynamically injecting Entities and Named Queries in my EntityManagerFactory, I use the method MutablePersistenceUnitInfo.addManagedPackage() to add a package for the EntityManagerFactory scan for entities.

However these packages never get scanned.
If I use the method MutablePersistenceUnitInfo.addManagedClassName() and manually add all the classes in thoses packages it works with no problem.

I'm I doing something wrong?
I have tried using these persistenceProviders with the same end result:

  • org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider
  • org.hibernate.jpa.HibernatePersistenceProvider

Affects: 4.1.5

Referenced from: commits 98d00ea, 4f1d9fd

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions