Class JPAConfig


  • @Singleton
    public class JPAConfig
    extends Object
    • Constructor Detail

    • Method Detail

      • startAll

        void startAll()
      • getEntityManagerFactory

        public javax.persistence.EntityManagerFactory getEntityManagerFactory​(String unitName)
      • getPersistenceUnits

        public Set<String> getPersistenceUnits()
        Returns the registered persistence units.
        Returns:
        Set containing the names of all registered persistence units.
      • getPersistenceUnitsForEntity

        public Set<String> getPersistenceUnitsForEntity​(String entityClass)
        Returns the set of persistence units an entity is attached to.
      • destroy

        void destroy​(@Observes @BeforeDestroyed(javax.enterprise.context.ApplicationScoped.class)
                     Object event)
        Need to shutdown all instances of Hibernate ORM before the actual destroy event, as it might need to use the datasources during shutdown.
        Parameters:
        event - ignored
      • destroy

        @PreDestroy
        void destroy()