Module org.eclipse.persistence.jpa
Class EntityManagerSetupImpl
java.lang.Object
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl
- All Implemented Interfaces:
MetadataRefreshListener
INTERNAL:
This class handles deployment of a persistence unit.
In predeploy the meta-data is processed and weaver transformer is returned to allow weaving of the persistent classes.
In deploy the project and session are initialize and registered.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EntityManagerSetupImpl
protected Set
<EntityManagerSetupImpl> static String[]
protected ConcurrencyManager
protected Boolean
static final String
Initial -----------> PredeployFailed --- | | V | Predeployed ---> DeployFailed -- | | | | V V V HalfDeployed --> Deployed -> Undeployed | ^ V | DeployFailed -------------------static final String
protected int
protected boolean
protected boolean
Used to indicate that an EntityManagerFactoryImpl based on this EntityManagerSetupImpl has been refreshed.protected boolean
protected boolean
protected PersistenceException
protected PersistenceUnitInfo
protected String
protected ProjectCache
protected boolean
protected SecurableObjectHolder
protected AbstractSession
protected String
protected boolean
protected String
Initial -----> HalfPredeployedCompositeMember -----> PredeployFailed | ^ | V------->| V Predeployedstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected StaticWeaveInfo
protected List
<StructConverter> -
Constructor Summary
ConstructorsConstructorDescriptionEntityManagerSetupImpl
(String persistenceUnitUniqueName, String sessionName) -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
addFileSeperator
(String appLocation) protected void
addProjectToSession
(ServerSession session, Project project) Adds descriptors plus sequencing info found on the project to the session.protected void
Put the given session into the session manager so it can be looked up latervoid
Add the StructConverters that were specified by annotation on the DatabasePlatform This method must be called after the DatabasePlatform has been detectedprotected void
Assign a CMP3Policy to each descriptor, and sets the OptimisticLockingPolicy's LockOnChangeMode if applicable.protected static Object
buildObjectForClass
(Class<?> clazz, Class<?> mustBeImplementedInterface) This method will be used to validate the specified class and return it's instance.protected static String
buildSessionNameSuffixFromConnectionProperties
(Map properties) void
changeSessionName
(String newSessionName) protected PersistenceException
protected PersistenceException
deploy
(ClassLoader realClassLoader, Map additionalProperties) Deploy a persistence session and return an EntityManagerFactory.protected void
deployCompositeMembers
(Map deployProperties, ClassLoader realClassLoader) protected static Class
<?> findClass
(String className, ClassLoader loader) protected static <T> Class
<T> findClassForProperty
(String className, String propertyName, ClassLoader loader) protected static Map
<String, SEPersistenceUnitInfo> getCompositeMemberPuInfoMap
(PersistenceUnitInfo puInfo, Map predeployProperties) protected static Set
<SEPersistenceUnitInfo> getCompositeMemberPuInfoSet
(PersistenceUnitInfo puInfo, Map predeployProperties) getConnectionPolicyExclusiveModeFromProperties
(Map m, AbstractSession abstractSession, boolean useSystemAsDefault) getDatabaseSession
(Map props) We may be provided a connection via the properties to use.protected DataSource
getDatasourceFromProperties
(Map m, String property, DataSource defaultDataSource) This is used to return either the defaultDatasource or, if one exists, a datasource defined under the property from the Map m.Return the name of the session this SetupImpl is building.int
getMetamodel
(ClassLoader classLoader) INTERNAL: Return an instance of Metamodel interface for access to the metamodel of the persistence unit.static String
getOrBuildSessionName
(Map properties, PersistenceUnitInfo puInfo, String persistenceUnitUniqueName) protected List
<StructConverter> getStructConverters
(ClassLoader realClassLoader) Internal: Returns a list of StructConverter instances from a list of StructConverter names stored within the project.protected boolean
protected boolean
protected void
INTERNAL: Initialize the Canonical Metamodel classes generated by EclipseLinkprotected void
initOrUpdateLogging
(Map m, SessionLog log) protected void
Normally when a property is missing nothing should be applied to the session.boolean
static boolean
isComposite
(PersistenceUnitInfo puInfo) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Used to indicate that an EntityManagerFactoryImpl based on this EntityManagerSetupImpl has been refreshed.boolean
boolean
boolean
boolean
protected boolean
isValidationOnly
(Map m, boolean shouldMergeMap) protected Map
boolean
static boolean
protected static void
overrideMemberProperties
(Map memberProperties, Map compositeProperties) predeploy
(PersistenceUnitInfo info, Map extendedProperties) Perform any steps necessary prior to actual deployment.protected void
predeployCompositeMembers
(Map predeployProperties, ClassLoader tempClassLoader) void
INTERNAL: First phase of canonical metamodel initialization.void
INTERNAL: Cause the first phase of metamodel initialization.protected void
processDescriptorCustomizers
(Map m, ClassLoader loader) protected void
processSessionCustomizer
(Map m, ClassLoader loader) refreshMetadata
(Map properties) Create a new version of this EntityManagerSetupImpl and cache it.protected void
This method can be used to ensure the session represented by emSetupImpl is removed from the SessionManager.void
setCompositeEmSetupImpl
(EntityManagerSetupImpl compositeEmSetupImpl) protected void
Copy named queries defined in EclipseLink descriptor into the session if it was indicated to do so.protected void
setExceptionHandler
(Map m, ClassLoader loader) Allow customized exception handler to be added into session.void
setIsInContainerMode
(boolean isInContainerMode) This sets the isInContainerMode flag.void
setIsMetadataExpired
(boolean hasExpiredMetadata) Used to indicate that an EntityManagerFactoryImpl based on this EntityManagerSetupImpl has been refreshed.void
setMetamodel
(Metamodel aMetamodel) INTERNAL: Convenience function to allow us to reset the Metamodel in the possible case that we want to regenerate it.void
setRequiresConnection
(boolean requiresConnection) INTERNAL: By default we require a connection to the database.protected void
setSessionEventListener
(Map m, ClassLoader loader) Allow customized session event listener to be added into session.void
setStaticWeaveInfo
(StaticWeaveInfo staticWeaveInfo) boolean
Return if the session should be deployed and connected during the creation of the EntityManagerFactory, or if it should be deferred until createEntityManager().boolean
boolean
Return if MetadataSource refresh commands should be sent when refresh is called Checks the PersistenceUnitProperties.METADATA_SOURCE_RCM_COMMAND property and defaults to true.static void
throwPersistenceUnitNameAlreadyInUseException
(String puName, PersistenceUnitInfo newPuInfo, PersistenceUnitInfo exsitingPuInfo) void
triggerMetadataRefresh
(Map properties) This method is just a wrapper on refreshMetadata so that core does not need a dependency on JPA due to the EntityManagerSetupImpl return value.void
undeploy()
Undeploy may be called several times, but only the call that decreases factoryCount to 0 disconnects the session and removes it from the session manager.protected void
Enable or disable extended logging of JPA L2 cache usage.protected void
Enable or disable extended thread logging.protected void
Enable or disable thread dump addition to extended thread logging.protected void
Enable or disable the capability of Native SQL function.protected void
Enable or disable query result cache validation.protected void
Enable or disable default allowing 0 as an id.protected void
updateBatchWritingSetting
(Map persistenceProperties, ClassLoader loader) Update batch writing setting.protected void
updateCacheCoordination
(Map m, ClassLoader loader) Configure cache coordination using properties.protected void
Enable or disable statements cached, update statements cache size.static void
updateCaseSensitivitySettings
(Map m, MetadataProject project, AbstractSession session) /** Enable or disable forcing field names to be case insensitive.protected void
updateCompositeMembersProperties
(Map compositeProperties) protected void
updateCompositeMembersProperties
(Set<SEPersistenceUnitInfo> compositePuInfos, Map compositeProperties) protected void
updateConnectionPolicy
(ServerSession serverSession, Map m) protected void
updateConnectionSettings
(ServerSession serverSession, Map properties) Process all properties under "eclipselink.connection-pool.".protected void
updateDatabaseEventListener
(Map m, ClassLoader loader) Checks for database events listener properties.protected void
updateDescriptorCacheSettings
(Map m, ClassLoader loader) protected void
Allow the deployment metadata to be freed post-deploy to conserve memory.protected void
Enable or disable default allowing 0 as an id.protected void
Sets shouldCreateIndicesOnForeignKeys DDL generation option.protected void
Enable or disable the capability of Native SQL function.protected void
updateLoggers
(Map persistenceProperties, boolean serverPlatformChanged, ClassLoader loader) Update loggers and settings for the singleton logger and the session logger.protected void
updateLoginDefaultConnector
(DatasourceLogin login, Map m) In cases where there is no data source, we will use properties to configure the login for our session.protected void
updateLogins
(Map m) Override the default login creation method.protected void
updateMetadataRepository
(Map m, ClassLoader loader) Load the Metadata Repository for Extensibilityprotected void
Enable or disable the capability of Native SQL function.protected void
updatePartitioning
(Map m, ClassLoader loader) Checks for partitioning properties.protected void
updatePessimisticLockTimeout
(Map persistenceProperties) Update the default pessimistic lock timeout value.protected void
updatePessimisticLockTimeoutUnit
(Map persistenceProperties) Update the default pessimistic lock timeout unit value.protected void
updatePools
(ServerSession serverSession, Map m) Configure the internal connection pooling parameters.protected void
updateProfiler
(Map persistenceProperties, ClassLoader loader) Check for the PROFILER persistence or system property and set the Session's profiler.protected void
updateProjectCache
(Map m, ClassLoader loader) Load the projectCacheAccessor for JPA project cachingprotected void
updateRemote
(Map m, ClassLoader loader) Checks for partitioning properties.protected void
Configure sequencing settings.protected void
protected void
updateSerializer
(Map m, ClassLoader loader) Update session serializer.protected boolean
updateServerPlatform
(Map m, ClassLoader loader) Updates the EclipseLink ServerPlatform class for use with this platform.protected void
updateSession
(Map m, ClassLoader loader) Make any changes to our ServerSession that can be made after it is created.protected void
Sets the SharedCacheMode with values from the jakarta.persistence.sharedCache.mode property.protected void
Update whether session ShouldOptimizeResultSetAccess.protected void
Enable or disable SQL casting.protected void
sets the TABLE_CREATION_SUFFIX property on the session's project to be applied to all table creation statements (DDL)protected void
Enable or disable default temporal mutable setting.protected void
updateTenancy
(Map m, ClassLoader loader) Update whether session should use externally defined multi tenancy.protected void
Update whether session should tolerate invalid JPQL at creation time.protected void
updateTunerDeploy
(Map m, ClassLoader loader) Check for a tuning property and run the tuner deploy.protected void
updateTunerPostDeploy
(Map m, ClassLoader loader) Check for a tuning property and run the tuner deploy.protected void
updateTunerPreDeploy
(Map m, ClassLoader loader) Check for a tuning property and run the tuner preDeploy.protected void
Enable or disable forcing field names to uppercase.protected void
writeDDL
(String generationSourceProperty, String scriptGenerationSourceProperty, EntityManagerSetupImpl.TableCreationType tableCreationType, Map props, DatabaseSessionImpl session, ClassLoader loader) INTERNAL: Generate the DDL per the properties given.protected void
writeDDL
(String ddlGeneration, Map props, DatabaseSessionImpl session, ClassLoader classLoader) INTERNAL: Generate the DDL from the persistence unit metadata.void
writeDDL
(Map props, DatabaseSessionImpl session, ClassLoader classLoader) INTERNAL: Generate the DDL per the properties specified.protected void
INTERNAL: Generate and write DDL from the persistence unit metadata to the database.protected void
writeDDLToFiles
(SchemaManager mgr, String appLocation, Object createDDLJdbc, Object dropDDLJdbc, EntityManagerSetupImpl.TableCreationType ddlType) Deprecated.protected void
writeDDLToFiles
(SchemaManager mgr, String appLocation, Object createDDLJdbc, Object dropDDLJdbc, EntityManagerSetupImpl.TableCreationType ddlType, Map props) Write the DDL to the files provided.protected void
writeMetadataDDLToDatabase
(EntityManagerSetupImpl.TableCreationType tableCreationType, Map props, DatabaseSessionImpl session, ClassLoader classLoader) INTERNAL: Generate and write DDL from the persistence unit metadata to the database.protected void
writeMetadataDDLToScript
(EntityManagerSetupImpl.TableCreationType tableCreationType, Map props, DatabaseSessionImpl session, ClassLoader classLoader) INTERNAL: Generate and write DDL from the persistence unit metadata to scripts.protected void
writeSourceScriptToDatabase
(Object source, DatabaseSessionImpl session, ClassLoader loader) This method will read SQL from a reader or URL and send it through to the database.
-
Field Details
-
persistenceUnitUniqueName
-
sessionName
-
persistenceUnitInfo
-
factoryCount
protected int factoryCount -
session
-
isInContainerMode
protected boolean isInContainerMode -
isSessionLoadedFromSessionsXML
protected boolean isSessionLoadedFromSessionsXML -
projectCacheAccessor
-
shouldBuildProject
protected boolean shouldBuildProject -
enableWeaving
-
isWeavingStatic
protected boolean isWeavingStatic -
staticWeaveInfo
-
securableObjectHolder
-
deployLock
-
requiresConnection
protected boolean requiresConnection -
structConverters
-
STATE_INITIAL
- See Also:
-
STATE_PREDEPLOYED
- See Also:
-
STATE_HALF_DEPLOYED
- See Also:
-
STATE_DEPLOYED
- See Also:
-
STATE_PREDEPLOY_FAILED
- See Also:
-
STATE_DEPLOY_FAILED
- See Also:
-
STATE_UNDEPLOYED
- See Also:
-
STATE_HALF_PREDEPLOYED_COMPOSITE_MEMBER
- See Also:
-
state
Initial -----> HalfPredeployedCompositeMember -----> PredeployFailed | ^ | V------->| V Predeployed -
ERROR_LOADING_XML_FILE
Initial -----------> PredeployFailed --- | | V | Predeployed ---> DeployFailed -- | | | | V V V HalfDeployed --> Deployed -> Undeployed | ^ V | DeployFailed -------------------- See Also:
-
EXCEPTION_LOADING_ENTITY_CLASS
- See Also:
-
connectionPropertyNames
-
compositeEmSetupImpl
-
compositeMemberEmSetupImpls
-
isMetadataExpired
protected boolean isMetadataExpiredUsed to indicate that an EntityManagerFactoryImpl based on this EntityManagerSetupImpl has been refreshed. This means this EntityManagerSetupImpl will no longer be associated with new EntityManagerFactories -
persistenceException
-
-
Constructor Details
-
EntityManagerSetupImpl
-
EntityManagerSetupImpl
public EntityManagerSetupImpl()
-
-
Method Details
-
addFileSeperator
-
getOrBuildSessionName
public static String getOrBuildSessionName(Map properties, PersistenceUnitInfo puInfo, String persistenceUnitUniqueName) -
buildSessionNameSuffixFromConnectionProperties
-
changeSessionName
-
removeSessionFromGlobalSessionManager
protected void removeSessionFromGlobalSessionManager()This method can be used to ensure the session represented by emSetupImpl is removed from the SessionManager. -
deploy
Deploy a persistence session and return an EntityManagerFactory. Deployment takes a session that was partially created in the predeploy call and makes it whole. This means doing any configuration that requires the real class definitions for the entities. In the predeploy phase we were in a stage where we were not let allowed to load the real classes. Deploy could be called several times - but only the first call does the actual deploying - additional calls allow to update session properties (in case the session is not connected). Note that there is no need to synchronize deploy method - it doesn't alter factoryCount and while deploy is executed no other method can alter the current state (predeploy call would just increment factoryCount; undeploy call would not drop factoryCount to 0). However precautions should be taken to handle concurrent calls to deploy, because those may alter the current state or connect the session.- Parameters:
realClassLoader
- The class loader that was used to load the entity classes. This loader will be maintained for the lifespan of the loaded classes.additionalProperties
- added to persistence unit properties for updateServerSession overriding existing properties. In JSE case it allows to alter properties in main (as opposed to preMain where preDeploy is called).- Returns:
- An EntityManagerFactory to be used by the Container to obtain EntityManagers
-
createDeployFailedPersistenceException
-
addProjectToSession
Adds descriptors plus sequencing info found on the project to the session. -
addSessionToGlobalSessionManager
protected void addSessionToGlobalSessionManager()Put the given session into the session manager so it can be looked up later -
addStructConverters
public void addStructConverters()Add the StructConverters that were specified by annotation on the DatabasePlatform This method must be called after the DatabasePlatform has been detected -
assignCMP3Policy
protected void assignCMP3Policy()Assign a CMP3Policy to each descriptor, and sets the OptimisticLockingPolicy's LockOnChangeMode if applicable. -
updateServerPlatform
Updates the EclipseLink ServerPlatform class for use with this platform.- Returns:
- true if the ServerPlatform has changed.
-
updatePartitioning
Checks for partitioning properties. -
updateRemote
Checks for partitioning properties. -
updateDatabaseEventListener
Checks for database events listener properties. -
updateLoggers
protected void updateLoggers(Map persistenceProperties, boolean serverPlatformChanged, ClassLoader loader) Update loggers and settings for the singleton logger and the session logger.- Parameters:
persistenceProperties
- the properties mapserverPlatformChanged
- the boolean that denotes a serverPlatform change in the session.
-
updateProfiler
Check for the PROFILER persistence or system property and set the Session's profiler. This can also set the QueryMonitor. -
findClass
protected static Class<?> findClass(String className, ClassLoader loader) throws ClassNotFoundException, PrivilegedActionException -
findClassForProperty
protected static <T> Class<T> findClassForProperty(String className, String propertyName, ClassLoader loader) -
getStructConverters
Internal: Returns a list of StructConverter instances from a list of StructConverter names stored within the project. -
hasSchemaDatabaseGeneration
-
hasSchemaScriptsGeneration
-
getSession
-
getDatabaseSession
-
getDatabaseSession
We may be provided a connection via the properties to use. Check for one and build a database session around it. Otherwise return the pu database session. -
buildObjectForClass
protected static Object buildObjectForClass(Class<?> clazz, Class<?> mustBeImplementedInterface) throws IllegalAccessException, PrivilegedActionException, InstantiationException This method will be used to validate the specified class and return it's instance. -
updateDescriptorCacheSettings
-
updateConnectionSettings
Process all properties under "eclipselink.connection-pool.". This allows for named connection pools. It also processes "read", "write", "default" and "sequence" connection pools. -
updateConnectionPolicy
-
getConnectionPolicyExclusiveModeFromProperties
public static ConnectionPolicy.ExclusiveMode getConnectionPolicyExclusiveModeFromProperties(Map m, AbstractSession abstractSession, boolean useSystemAsDefault) -
predeploy
Perform any steps necessary prior to actual deployment. This includes any steps in the session creation that do not require the real loaded domain classes. The first call to this method caches persistenceUnitInfo which is reused in the following calls. Note that in JSE case factoryCount is NOT incremented on the very first call (by JavaSECMPInitializer.callPredeploy, typically in preMain). That provides 1 to 1 correspondence between factoryCount and the number of open factories. In case factoryCount > 0 the method just increments factoryCount. factory == 0 triggers creation of a new session. This method and undeploy - the only methods altering factoryCount - should be synchronized.- Returns:
- A transformer (which may be null) that should be plugged into the proper classloader to allow classes to be transformed as they get loaded.
- See Also:
-
createPredeployFailedPersistenceException
-
getDeployedSessionName
Return the name of the session this SetupImpl is building. The session name is only known at deploy time and if this method is called prior to that, this method will return null. -
getPersistenceUnitInfo
-
isValidationOnly
-
isValidationOnly
-
shouldGetSessionOnCreateFactory
Return if the session should be deployed and connected during the creation of the EntityManagerFactory, or if it should be deferred until createEntityManager(). The default is to defer, but is only validating, or can be configured to deploy upfront to avoid hanging the application at runtime. -
mergeWithExistingMap
-
isInContainerMode
public boolean isInContainerMode() -
updateCacheCoordination
Configure cache coordination using properties. -
updateSerializer
Update session serializer. -
updateShouldOptimizeResultSetAccess
Update whether session ShouldOptimizeResultSetAccess. -
updateTenancy
Update whether session should use externally defined multi tenancy. -
updateTolerateInvalidJPQL
Update whether session should tolerate invalid JPQL at creation time. -
updateLogins
Override the default login creation method. If persistenceInfo is available, use the information from it to setup the login and possibly to set readConnectionPool. -
getDatasourceFromProperties
protected DataSource getDatasourceFromProperties(Map m, String property, DataSource defaultDataSource) This is used to return either the defaultDatasource or, if one exists, a datasource defined under the property from the Map m. This method will build a DataSourceImpl object to hold the url if the property in Map m defines a string instead of a datasource. -
updateLoginDefaultConnector
In cases where there is no data source, we will use properties to configure the login for our session. This method gets those properties and sets them on the login. -
updatePools
Configure the internal connection pooling parameters. By default if nothing is configured a default shared (exclusive) read/write pool is used with 32 min/max connections and 1 initial. -
initSession
protected void initSession()Normally when a property is missing nothing should be applied to the session. However there are several session attributes that defaulted in EJB3 to the values different from EclipseLink defaults. This function applies defaults for such properties and registers the session. All other session-related properties are applied in updateServerSession. Note that updateSession may be called several times on the same session (before login), but initSession is called just once - before the first call to updateSession. -
updateSession
Make any changes to our ServerSession that can be made after it is created. -
setIsInContainerMode
public void setIsInContainerMode(boolean isInContainerMode) This sets the isInContainerMode flag. "true" indicates container case, "false" - SE. -
setIsMetadataExpired
public void setIsMetadataExpired(boolean hasExpiredMetadata) Used to indicate that an EntityManagerFactoryImpl based on this EntityManagerSetupImpl has been refreshed. This means this EntityManagerSetupImpl will no longer be associated with new EntityManagerFactories -
processSessionCustomizer
-
initOrUpdateLogging
-
processDescriptorCustomizers
-
isInitial
public boolean isInitial() -
isMetadataExpired
public boolean isMetadataExpired()Used to indicate that an EntityManagerFactoryImpl based on this EntityManagerSetupImpl has been refreshed. This means this EntityManagerSetupImpl will no longer be associated with new EntityManagerFactories -
isPredeployed
public boolean isPredeployed() -
isDeployed
public boolean isDeployed() -
isHalfDeployed
public boolean isHalfDeployed() -
isUndeployed
public boolean isUndeployed() -
isPredeployFailed
public boolean isPredeployFailed() -
isDeployFailed
public boolean isDeployFailed() -
isHalfPredeployedCompositeMember
public boolean isHalfPredeployedCompositeMember() -
getPersistenceUnitUniqueName
-
getFactoryCount
public int getFactoryCount() -
getSessionName
-
shouldRedeploy
public boolean shouldRedeploy() -
shouldSendMetadataRefreshCommand
Return if MetadataSource refresh commands should be sent when refresh is called Checks the PersistenceUnitProperties.METADATA_SOURCE_RCM_COMMAND property and defaults to true. -
undeploy
public void undeploy()Undeploy may be called several times, but only the call that decreases factoryCount to 0 disconnects the session and removes it from the session manager. This method and predeploy - the only methods altering factoryCount - should be synchronized. After undeploy call that turns factoryCount to 0: session==null; PREDEPLOYED, DEPLOYED and DEPLOYED_FAILED states change to UNDEPLOYED state. -
setRequiresConnection
public void setRequiresConnection(boolean requiresConnection) INTERNAL: By default we require a connection to the database. However, when generating schema to scripts only, this is not required. -
setSessionEventListener
Allow customized session event listener to be added into session. The method needs to be called in deploy stage. -
setExceptionHandler
Allow customized exception handler to be added into session. The method needs to be called in deploy and pre-deploy stage. -
updateBatchWritingSetting
Update batch writing setting. The method needs to be called in deploy stage. -
updateMetadataRepository
Load the Metadata Repository for Extensibility -
updateTunerPreDeploy
Check for a tuning property and run the tuner preDeploy. -
updateTunerDeploy
Check for a tuning property and run the tuner deploy. -
updateTunerPostDeploy
Check for a tuning property and run the tuner deploy. -
updateFreeMemory
Allow the deployment metadata to be freed post-deploy to conserve memory. -
updateNativeSQLSetting
Enable or disable the capability of Native SQL function. The method needs to be called in deploy stage. -
updateSequencing
Configure sequencing settings. -
updateSequencingStart
-
updateProjectCache
Load the projectCacheAccessor for JPA project caching -
updateJPQLParser
Enable or disable the capability of Native SQL function. The method needs to be called in deploy stage. -
updateAllowNativeSQLQueriesSetting
Enable or disable the capability of Native SQL function. The method needs to be called in deploy stage. -
updateSQLCastSetting
Enable or disable SQL casting. -
updateUppercaseSetting
Enable or disable forcing field names to uppercase. The method needs to be called in deploy stage. -
updateCaseSensitivitySettings
public static void updateCaseSensitivitySettings(Map m, MetadataProject project, AbstractSession session) /** Enable or disable forcing field names to be case insensitive. Implementation of case insensitive column handling relies on setting both sides to uppercase (the column names from annotations/xml as well as what is returned from the JDBC/statement) The method needs to be called in deploy stage. -
updatePessimisticLockTimeout
Update the default pessimistic lock timeout value.- Parameters:
persistenceProperties
- the properties map
-
updatePessimisticLockTimeoutUnit
Update the default pessimistic lock timeout unit value.- Parameters:
persistenceProperties
- the properties map
-
updateCacheStatementSettings
Enable or disable statements cached, update statements cache size. The method needs to be called in deploy stage. -
updateAllowZeroIdSetting
Enable or disable default allowing 0 as an id. -
updateIdValidation
Enable or disable default allowing 0 as an id. -
updateTableCreationSettings
sets the TABLE_CREATION_SUFFIX property on the session's project to be applied to all table creation statements (DDL) -
updateIndexForeignKeys
Sets shouldCreateIndicesOnForeignKeys DDL generation option. -
updateTemporalMutableSetting
Enable or disable default temporal mutable setting. The method needs to be called in deploy stage. -
setDescriptorNamedQueries
Copy named queries defined in EclipseLink descriptor into the session if it was indicated to do so. -
updateAllowExtendedCacheLogging
Enable or disable extended logging of JPA L2 cache usage. The method needs to be called in deploy stage. -
updateAllowExtendedThreadLogging
Enable or disable extended thread logging. The method needs to be called in deploy stage. -
updateAllowExtendedThreadLoggingThreadDump
Enable or disable thread dump addition to extended thread logging. The method needs to be called in deploy stage. -
updateAllowQueryResultsCacheValidation
Enable or disable query result cache validation. The method needs to be called in deploy stage. -
getMetamodel
INTERNAL: Return an instance of Metamodel interface for access to the metamodel of the persistence unit. This method will complete any initialization done in the predeploy phase of deployment.- Returns:
- Metamodel instance
- Since:
- Java Persistence 2.0
-
initializeCanonicalMetamodel
INTERNAL: Initialize the Canonical Metamodel classes generated by EclipseLink- Since:
- Java Persistence 2.0
-
setMetamodel
INTERNAL: Convenience function to allow us to reset the Metamodel in the possible case that we want to regenerate it. This function is outside of the JPA 2.0 specification.- Since:
- Java Persistence 2.0
-
mustBeCompositeMember
public boolean mustBeCompositeMember() -
isCompositeMember
public boolean isCompositeMember() -
isComposite
public boolean isComposite() -
mustBeCompositeMember
-
isComposite
-
setCompositeEmSetupImpl
-
getCompositeEmSetupImpl
-
setStaticWeaveInfo
-
predeployCompositeMembers
-
deployCompositeMembers
-
preInitializeMetamodel
public void preInitializeMetamodel()INTERNAL: Cause the first phase of metamodel initialization. This phase involves detecting the classes involved and build metamodel instances for them. -
preInitializeCanonicalMetamodel
INTERNAL: First phase of canonical metamodel initialization. For each class the metamodel is aware of, check for a canonical metamodel class and initialize each attribute in it with a proxy that can cause the rest of the metamodel population. Attributes are found reflectively rather than through the metamodel to avoid having to further initialize the metamodel. -
updateCompositeMembersProperties
-
updateCompositeMembersProperties
protected void updateCompositeMembersProperties(Set<SEPersistenceUnitInfo> compositePuInfos, Map compositeProperties) -
overrideMemberProperties
-
getCompositeMemberPuInfoMap
protected static Map<String,SEPersistenceUnitInfo> getCompositeMemberPuInfoMap(PersistenceUnitInfo puInfo, Map predeployProperties) -
getCompositeMemberPuInfoSet
protected static Set<SEPersistenceUnitInfo> getCompositeMemberPuInfoSet(PersistenceUnitInfo puInfo, Map predeployProperties) -
throwPersistenceUnitNameAlreadyInUseException
public static void throwPersistenceUnitNameAlreadyInUseException(String puName, PersistenceUnitInfo newPuInfo, PersistenceUnitInfo exsitingPuInfo) -
refreshMetadata
Create a new version of this EntityManagerSetupImpl and cache it. Prepare "this" EntityManagerSetupImpl for garbage collection. This call will mean any users of this EntityManagerSetupImpl will get the new version the next time they look it up (for instance and EntityManager creation time) -
triggerMetadataRefresh
This method is just a wrapper on refreshMetadata so that core does not need a dependency on JPA due to the EntityManagerSetupImpl return value. This method satisfies the MetedataRefreshListener implementation and is called by incoming RCM refresh commands- Specified by:
triggerMetadataRefresh
in interfaceMetadataRefreshListener
- See Also:
-
writeDDL
INTERNAL: Generate the DDL per the properties specified. -
writeDDL
protected void writeDDL(String ddlGeneration, Map props, DatabaseSessionImpl session, ClassLoader classLoader) INTERNAL: Generate the DDL from the persistence unit metadata. This DDL generation utilizes the EclipseLink DDL properties. -
writeDDL
protected void writeDDL(String generationSourceProperty, String scriptGenerationSourceProperty, EntityManagerSetupImpl.TableCreationType tableCreationType, Map props, DatabaseSessionImpl session, ClassLoader loader) INTERNAL: Generate the DDL per the properties given. -
writeDDLToDatabase
protected void writeDDLToDatabase(SchemaManager mgr, EntityManagerSetupImpl.TableCreationType ddlType) INTERNAL: Generate and write DDL from the persistence unit metadata to the database. -
writeDDLToFiles
@Deprecated protected void writeDDLToFiles(SchemaManager mgr, String appLocation, Object createDDLJdbc, Object dropDDLJdbc, EntityManagerSetupImpl.TableCreationType ddlType) Deprecated.Extenders should now usewriteDDLToFiles(SchemaManager, String, Object, Object, TableCreationType, Map)
-
writeDDLToFiles
protected void writeDDLToFiles(SchemaManager mgr, String appLocation, Object createDDLJdbc, Object dropDDLJdbc, EntityManagerSetupImpl.TableCreationType ddlType, Map props) Write the DDL to the files provided. -
writeMetadataDDLToDatabase
protected void writeMetadataDDLToDatabase(EntityManagerSetupImpl.TableCreationType tableCreationType, Map props, DatabaseSessionImpl session, ClassLoader classLoader) INTERNAL: Generate and write DDL from the persistence unit metadata to the database. -
writeMetadataDDLToScript
protected void writeMetadataDDLToScript(EntityManagerSetupImpl.TableCreationType tableCreationType, Map props, DatabaseSessionImpl session, ClassLoader classLoader) INTERNAL: Generate and write DDL from the persistence unit metadata to scripts. -
writeSourceScriptToDatabase
protected void writeSourceScriptToDatabase(Object source, DatabaseSessionImpl session, ClassLoader loader) This method will read SQL from a reader or URL and send it through to the database. This could open up the database to SQL injection if not careful.
-
writeDDLToFiles(SchemaManager, String, Object, Object, TableCreationType, Map)