Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-12821

Doc: MutablePersistenceUnitInfo.addManagedPackage() not triggering a package scan

    XMLWordPrintable

    Details

    • Last commented by a User:
      true

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            ffleandro Filipe Leandro
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 1 week, 4 days ago