Class EntityManagerFactoryProvider

java.lang.Object
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider

public class EntityManagerFactoryProvider extends Object
This is a helper/impl class for the EclipseLink EJB 3.0 provider The default constructor can be used to build the provider by reflection, after which it can be used to create EntityManagerFactories
  • Field Details

  • Constructor Details

    • EntityManagerFactoryProvider

      public EntityManagerFactoryProvider()
      Default constructor to allow reflection.
  • Method Details

    • addEntityManagerSetupImpl

      public static void addEntityManagerSetupImpl(String name, EntityManagerSetupImpl setup)
      Add an EntityManagerSetupImpl to the cached list These are used to ensure all persistence units that are the same get the same underlying session
    • generateDefaultTables

      protected static void generateDefaultTables(SchemaManager mgr, EntityManagerSetupImpl.TableCreationType ddlType)
      Calls the appropriate create,replace or alter SchemaManager api.
      Parameters:
      ddlType - - ddl operation to be performed
    • getConfigPropertyAsString

      public static String getConfigPropertyAsString(String propertyKey, Map overrides)
      Get configuration System property indicated by the specified propertyKey. Property value may be overridden by overrides Map.
      Parameters:
      propertyKey - The name of the configuration System property.
      overrides - Map with property overrides.
      Returns:
      The String value of the property from overrides Map or value of configuration System property or null if property identified by propertyKey does not exist.
    • getConfigPropertyAsString

      public static String getConfigPropertyAsString(String propertyKey, Map overrides, String defaultValue)
      Check the provided map for an object with the given key. If that object is not available, check the System properties. If it is not available from either location, return the default value.
    • getConfigPropertyAsStringLogDebug

      protected static String getConfigPropertyAsStringLogDebug(String propertyKey, Map overrides, AbstractSession session)
    • getConfigPropertyAsStringLogDebug

      protected static String getConfigPropertyAsStringLogDebug(String propertyKey, Map overrides, AbstractSession session, boolean useSystemAsDefault)
    • getConfigPropertyAsStringLogDebug

      protected static String getConfigPropertyAsStringLogDebug(String propertyKey, Map overrides, String defaultValue, AbstractSession session)
    • getConfigPropertyLogDebug

      protected static Object getConfigPropertyLogDebug(String propertyKey, Map overrides, AbstractSession session)
    • getConfigPropertyLogDebug

      protected static Object getConfigPropertyLogDebug(String propertyKey, Map overrides, AbstractSession session, boolean useSystemAsDefault)
    • hasConfigProperty

      public static boolean hasConfigProperty(String propertyKey, Map overrides)
    • getConfigProperty

      protected static Object getConfigProperty(String propertyKey, Map overrides)
    • getConfigProperty

      protected static Object getConfigProperty(String propertyKey, Map overrides, boolean useSystemAsDefault)
    • getConfigProperty

      protected static Object getConfigProperty(String propertyKey, Map overrides, Object defaultObj)
    • getEntityManagerSetupImpl

      public static EntityManagerSetupImpl getEntityManagerSetupImpl(String emName)
      Return the setup class for a given entity manager name
    • getEmSetupImpls

      public static Map<String,EntityManagerSetupImpl> getEmSetupImpls()
    • login

      protected static void login(DatabaseSessionImpl session, Map properties, boolean requiresConnection)
      Logs in to given session. If user has not specified TARGET_DATABASE the platform would be auto detected
      Parameters:
      session - The session to login to.
      properties - User specified properties for the persistence unit
    • mergeMaps

      public static <K, V> Map<K,V> mergeMaps(Map<K,V> target, Map<K,V> source)
      Merge the properties from the source object into the target object. If the property exists in both objects, use the one from the target
      Returns:
      the target object
    • removeSpecifiedProperties

      public static <K, V> Map<K,V> removeSpecifiedProperties(Map<K,V> source, Collection<K> keysToBeRemoved)
      Copies source into target, removes from target all keysToBeRemoved.
      Returns:
      the target object
    • keepSpecifiedProperties

      public static <K, V> Map<K,V> keepSpecifiedProperties(Map<K,V> source, Collection<K> keysToBeKept)
      target contains the entries from source with keysToBeKept.
      Returns:
      the target object
    • splitSpecifiedProperties

      public static <K, V> Map<K,V>[] splitSpecifiedProperties(Map<K,V> source, Collection<K> keysToBeKept)
      target is a array of two Maps the first one contains specified properties; the second all the rest.
      Returns:
      the target object
    • splitProperties

      public static <K, V> Map<K,V>[] splitProperties(Map<K,V> source, Collection<K>[] keys)
      Source Map is divided between Map[] in target. Target's i-th member contains all source's Map.Entries keys for which are in keys[i] Collection. Target's size equals keys' size + 1: all the source's Map.Entries not found in any of keys Collections go into the last target's map.
      Parameters:
      keys - is array of Maps of size n
      Returns:
      the target object is array of Maps of size n+1
    • translateOldProperties

      protected static void translateOldProperties(Map m, AbstractSession session)
      This is a TEMPORARY method that will be removed. DON'T USE THIS METHOD - for internal use only.
    • warnOldProperties

      protected static void warnOldProperties(Map m, AbstractSession session)