com.github.database.rider.core.util

Class EntityManagerProvider

  • All Implemented Interfaces:
    org.junit.rules.TestRule


    public class EntityManagerProviderextends Objectimplements org.junit.rules.TestRule
    • Method Detail

      • instance

        public static EntityManagerProvider instance(String unitName,                                             Map<String,String> overridingPersistenceProps)
        Allows to pass in overriding Properties that may be specific to the JPA Vendor.
        Parameters:
        unitName - unit name
        overridingPersistenceProps - properties to override persistence.xml props or define additions to them
        Returns:
        EntityManagerProvider instance
      • newInstance

        public static EntityManagerProvider newInstance(String unitName)
        Parameters:
        unitName - unit name clear entities on underlying context
        Returns:
        a clean EntityManagerProvider
      • connection

        public Connection connection(String puName)
        Parameters:
        puName - unit name
        Returns:
        jdbc connection of provider instance represented by given puName
      • connection

        public Connection connection()
        Returns:
        jdbc conection of current provider instance
      • em

        public static javax.persistence.EntityManager em(String puName)
        Parameters:
        puName - unit name
        Returns:
        entityManager represented by given puName
      • emf

        public static javax.persistence.EntityManagerFactory emf(String puName)
        Parameters:
        puName - unit name
        Returns:
        entityManagerFactory represented by given puName
      • em

        public static javax.persistence.EntityManager em()
        Returns:
        entityManager of current instance of this provider
      • getEm

        public javax.persistence.EntityManager getEm()
      • emf

        public static javax.persistence.EntityManagerFactory emf()
      • getEmf

        public javax.persistence.EntityManagerFactory getEmf()
      • getEm

        public javax.persistence.EntityManager getEm(String puName)
      • clear

        public static EntityManagerProvider clear(String puName)
        Parameters:
        puName - unit name clears entityManager persistence context and entityManager factory cache represented by given puName
        Returns:
        provider represented by puName
      • clear

        public static EntityManagerProvider clear()
        clears entityManager persistence context and entity manager factory cache of current instance of this provider
        Returns:
        current provider
      • tx

        public static javax.persistence.EntityTransaction tx(String puName)
        Parameters:
        puName - unit name
        Returns:
        transaction of entityManager represented by given puName
      • tx

        public static javax.persistence.EntityTransaction tx()
        Returns:
        transaction of entityManager of current instance of this provider
      • apply

        public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,                                               org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule
      • isEntityManagerActive

        public static boolean isEntityManagerActive()

Copyright © 2019. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14