Module org.eclipse.persistence.jpa
Class EntityManagerFactoryProvider
java.lang.Object
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider
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 Summary
Modifier and TypeFieldDescriptionstatic final Map
<String, EntityManagerSetupImpl> protected static final String[][]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 sessionprotected static void
Calls the appropriate create,replace or alter SchemaManager api.protected static Object
getConfigProperty
(String propertyKey, Map overrides) protected static Object
getConfigProperty
(String propertyKey, Map overrides, boolean useSystemAsDefault) protected static Object
getConfigProperty
(String propertyKey, Map overrides, Object defaultObj) static String
getConfigPropertyAsString
(String propertyKey, Map overrides) Get configurationSystem
property indicated by the specifiedpropertyKey
.static String
getConfigPropertyAsString
(String propertyKey, Map overrides, String defaultValue) Check the provided map for an object with the given key.protected static String
getConfigPropertyAsStringLogDebug
(String propertyKey, Map overrides, String defaultValue, AbstractSession session) protected static String
getConfigPropertyAsStringLogDebug
(String propertyKey, Map overrides, AbstractSession session) protected static String
getConfigPropertyAsStringLogDebug
(String propertyKey, Map overrides, AbstractSession session, boolean useSystemAsDefault) protected static Object
getConfigPropertyLogDebug
(String propertyKey, Map overrides, AbstractSession session) protected static Object
getConfigPropertyLogDebug
(String propertyKey, Map overrides, AbstractSession session, boolean useSystemAsDefault) static Map
<String, EntityManagerSetupImpl> static EntityManagerSetupImpl
getEntityManagerSetupImpl
(String emName) Return the setup class for a given entity manager namestatic boolean
hasConfigProperty
(String propertyKey, Map overrides) static <K,
V> Map <K, V> keepSpecifiedProperties
(Map<K, V> source, Collection<K> keysToBeKept) target contains the entries from source with keysToBeKept.protected static void
login
(DatabaseSessionImpl session, Map properties, boolean requiresConnection) Logs in to given session.static <K,
V> Map <K, V> Merge the properties from the source object into the target object.static <K,
V> Map <K, V> removeSpecifiedProperties
(Map<K, V> source, Collection<K> keysToBeRemoved) Copies source into target, removes from target all keysToBeRemoved.static <K,
V> Map<K, V>[] splitProperties
(Map<K, V> source, Collection<K>[] keys) Source Map is divided between Map[] in target.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.protected static void
translateOldProperties
(Map m, AbstractSession session) This is a TEMPORARY method that will be removed.protected static void
warnOldProperties
(Map m, AbstractSession session)
-
Field Details
-
emSetupImpls
-
oldPropertyNames
-
-
Constructor Details
-
EntityManagerFactoryProvider
public EntityManagerFactoryProvider()Default constructor to allow reflection.
-
-
Method Details
-
addEntityManagerSetupImpl
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
-
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
-
getConfigProperty
-
getConfigProperty
-
getConfigProperty
-
getEntityManagerSetupImpl
Return the setup class for a given entity manager name -
getEmSetupImpls
-
login
protected static void login(DatabaseSessionImpl session, Map properties, boolean requiresConnection) Logs in to given session. If user has not specifiedTARGET_DATABASE
the platform would be auto detected- Parameters:
session
- The session to login to.properties
- User specified properties for the persistence unit
-
mergeMaps
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
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
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
This is a TEMPORARY method that will be removed. DON'T USE THIS METHOD - for internal use only. -
warnOldProperties
-