Class EntityManagerFactoryProvider
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider
-
public class EntityManagerFactoryProvider extends java.lang.ObjectThis 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
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,EntityManagerSetupImpl>emSetupImplsprotected static java.lang.String[][]oldPropertyNames
-
Constructor Summary
Constructors Constructor Description EntityManagerFactoryProvider()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddEntityManagerSetupImpl(java.lang.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 voidgenerateDefaultTables(org.eclipse.persistence.tools.schemaframework.SchemaManager mgr, EntityManagerSetupImpl.TableCreationType ddlType)Calls the appropriate create,replace or alter SchemaManager api.protected static java.lang.ObjectgetConfigProperty(java.lang.String propertyKey, java.util.Map overrides)protected static java.lang.ObjectgetConfigProperty(java.lang.String propertyKey, java.util.Map overrides, boolean useSystemAsDefault)protected static java.lang.ObjectgetConfigProperty(java.lang.String propertyKey, java.util.Map overrides, java.lang.Object defaultObj)static java.lang.StringgetConfigPropertyAsString(java.lang.String propertyKey, java.util.Map overrides)Get configurationSystemproperty indicated by the specifiedpropertyKey.static java.lang.StringgetConfigPropertyAsString(java.lang.String propertyKey, java.util.Map overrides, java.lang.String defaultValue)Check the provided map for an object with the given key.protected static java.lang.StringgetConfigPropertyAsStringLogDebug(java.lang.String propertyKey, java.util.Map overrides, java.lang.String defaultValue, org.eclipse.persistence.internal.sessions.AbstractSession session)protected static java.lang.StringgetConfigPropertyAsStringLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session)protected static java.lang.StringgetConfigPropertyAsStringLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean useSystemAsDefault)protected static java.lang.ObjectgetConfigPropertyLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session)protected static java.lang.ObjectgetConfigPropertyLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean useSystemAsDefault)static java.util.Map<java.lang.String,EntityManagerSetupImpl>getEmSetupImpls()static EntityManagerSetupImplgetEntityManagerSetupImpl(java.lang.String emName)Return the setup class for a given entity manager namestatic booleanhasConfigProperty(java.lang.String propertyKey, java.util.Map overrides)static java.util.MapkeepSpecifiedProperties(java.util.Map source, java.util.Collection keysToBeKept)target contains the entries from source with keysToBeKept.protected static voidlogin(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session, java.util.Map properties, boolean requiresConnection)Logs in to given session.static java.util.MapmergeMaps(java.util.Map target, java.util.Map source)Merge the properties from the source object into the target object.static java.util.MapremoveSpecifiedProperties(java.util.Map source, java.util.Collection keysToBeRemoved)Copies source into target, removes from target all keysToBeRemoved.static java.util.Map[]splitProperties(java.util.Map source, java.util.Collection[] keys)Source Map is divided between Map[] in target.static java.util.Map[]splitSpecifiedProperties(java.util.Map source, java.util.Collection keysToBeKept)target is a array of two Maps the first one contains specified properties; the second all the rest.protected static voidtranslateOldProperties(java.util.Map m, org.eclipse.persistence.internal.sessions.AbstractSession session)This is a TEMPORARY method that will be removed.protected static voidwarnOldProperties(java.util.Map m, org.eclipse.persistence.internal.sessions.AbstractSession session)
-
-
-
Field Detail
-
emSetupImpls
public static final java.util.Map<java.lang.String,EntityManagerSetupImpl> emSetupImpls
-
oldPropertyNames
protected static final java.lang.String[][] oldPropertyNames
-
-
Method Detail
-
addEntityManagerSetupImpl
public static void addEntityManagerSetupImpl(java.lang.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- Parameters:
name-setup-
-
generateDefaultTables
protected static void generateDefaultTables(org.eclipse.persistence.tools.schemaframework.SchemaManager mgr, EntityManagerSetupImpl.TableCreationType ddlType)Calls the appropriate create,replace or alter SchemaManager api.- Parameters:
mgr-ddlType- - ddl operation to be performed
-
getConfigPropertyAsString
public static java.lang.String getConfigPropertyAsString(java.lang.String propertyKey, java.util.Map overrides)Get configurationSystemproperty indicated by the specifiedpropertyKey. Property value may be overridden byoverridesMap.- Parameters:
propertyKey- The name of the configurationSystemproperty.overrides-Mapwith property overrides.- Returns:
- The
Stringvalue of the property fromoverridesMapor value of configurationSystemproperty ornullif property identified bypropertyKeydoes not exist.
-
getConfigPropertyAsString
public static java.lang.String getConfigPropertyAsString(java.lang.String propertyKey, java.util.Map overrides, java.lang.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.- Parameters:
propertyKey-overrides-defaultValue-- Returns:
-
getConfigPropertyAsStringLogDebug
protected static java.lang.String getConfigPropertyAsStringLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session)
-
getConfigPropertyAsStringLogDebug
protected static java.lang.String getConfigPropertyAsStringLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean useSystemAsDefault)
-
getConfigPropertyAsStringLogDebug
protected static java.lang.String getConfigPropertyAsStringLogDebug(java.lang.String propertyKey, java.util.Map overrides, java.lang.String defaultValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
-
getConfigPropertyLogDebug
protected static java.lang.Object getConfigPropertyLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session)
-
getConfigPropertyLogDebug
protected static java.lang.Object getConfigPropertyLogDebug(java.lang.String propertyKey, java.util.Map overrides, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean useSystemAsDefault)
-
hasConfigProperty
public static boolean hasConfigProperty(java.lang.String propertyKey, java.util.Map overrides)
-
getConfigProperty
protected static java.lang.Object getConfigProperty(java.lang.String propertyKey, java.util.Map overrides)
-
getConfigProperty
protected static java.lang.Object getConfigProperty(java.lang.String propertyKey, java.util.Map overrides, boolean useSystemAsDefault)
-
getConfigProperty
protected static java.lang.Object getConfigProperty(java.lang.String propertyKey, java.util.Map overrides, java.lang.Object defaultObj)
-
getEntityManagerSetupImpl
public static EntityManagerSetupImpl getEntityManagerSetupImpl(java.lang.String emName)
Return the setup class for a given entity manager name- Parameters:
emName-
-
getEmSetupImpls
public static java.util.Map<java.lang.String,EntityManagerSetupImpl> getEmSetupImpls()
-
login
protected static void login(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session, java.util.Map properties, boolean requiresConnection)Logs in to given session. If user has not specifiedTARGET_DATABASEthe platform would be auto detected- Parameters:
session- The session to login to.properties- User specified properties for the persistence unit
-
mergeMaps
public static java.util.Map mergeMaps(java.util.Map target, java.util.Map 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- Parameters:
target-source-- Returns:
- the target object
-
removeSpecifiedProperties
public static java.util.Map removeSpecifiedProperties(java.util.Map source, java.util.Collection keysToBeRemoved)Copies source into target, removes from target all keysToBeRemoved.- Parameters:
source-keysToBeRemoved-- Returns:
- the target object
-
keepSpecifiedProperties
public static java.util.Map keepSpecifiedProperties(java.util.Map source, java.util.Collection keysToBeKept)target contains the entries from source with keysToBeKept.- Parameters:
source-keysToBeKept-- Returns:
- the target object
-
splitSpecifiedProperties
public static java.util.Map[] splitSpecifiedProperties(java.util.Map source, java.util.Collection keysToBeKept)target is a array of two Maps the first one contains specified properties; the second all the rest.- Parameters:
source-keysToBeKept-- Returns:
- the target object
-
splitProperties
public static java.util.Map[] splitProperties(java.util.Map source, java.util.Collection[] 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:
source-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(java.util.Map m, org.eclipse.persistence.internal.sessions.AbstractSession session)This is a TEMPORARY method that will be removed. DON'T USE THIS METHOD - for internal use only.- Parameters:
Map- mAbstractSession- session
-
warnOldProperties
protected static void warnOldProperties(java.util.Map m, org.eclipse.persistence.internal.sessions.AbstractSession session)
-
-