Class EntityManagerSetupImpl

java.lang.Object
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl
All Implemented Interfaces:
MetadataRefreshListener

public class EntityManagerSetupImpl extends Object implements 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.
  • Field Details

    • persistenceUnitUniqueName

      protected String persistenceUnitUniqueName
    • sessionName

      protected String sessionName
    • persistenceUnitInfo

      protected PersistenceUnitInfo persistenceUnitInfo
    • factoryCount

      protected int factoryCount
    • session

      protected AbstractSession session
    • isInContainerMode

      protected boolean isInContainerMode
    • isSessionLoadedFromSessionsXML

      protected boolean isSessionLoadedFromSessionsXML
    • projectCacheAccessor

      protected ProjectCache projectCacheAccessor
    • shouldBuildProject

      protected boolean shouldBuildProject
    • enableWeaving

      protected Boolean enableWeaving
    • isWeavingStatic

      protected boolean isWeavingStatic
    • staticWeaveInfo

      protected StaticWeaveInfo staticWeaveInfo
    • securableObjectHolder

      protected SecurableObjectHolder securableObjectHolder
    • deployLock

      protected ConcurrencyManager deployLock
    • requiresConnection

      protected boolean requiresConnection
    • structConverters

      protected List<StructConverter> structConverters
    • STATE_INITIAL

      public static final String STATE_INITIAL
      See Also:
    • STATE_PREDEPLOYED

      public static final String STATE_PREDEPLOYED
      See Also:
    • STATE_HALF_DEPLOYED

      public static final String STATE_HALF_DEPLOYED
      See Also:
    • STATE_DEPLOYED

      public static final String STATE_DEPLOYED
      See Also:
    • STATE_PREDEPLOY_FAILED

      public static final String STATE_PREDEPLOY_FAILED
      See Also:
    • STATE_DEPLOY_FAILED

      public static final String STATE_DEPLOY_FAILED
      See Also:
    • STATE_UNDEPLOYED

      public static final String STATE_UNDEPLOYED
      See Also:
    • STATE_HALF_PREDEPLOYED_COMPOSITE_MEMBER

      public static final String STATE_HALF_PREDEPLOYED_COMPOSITE_MEMBER
      See Also:
    • state

      protected String state
      Initial -----> HalfPredeployedCompositeMember -----> PredeployFailed | ^ | V------->| V Predeployed
    • ERROR_LOADING_XML_FILE

      public static final String ERROR_LOADING_XML_FILE
      Initial -----------> PredeployFailed --- | | V | Predeployed ---> DeployFailed -- | | | | V V V HalfDeployed --> Deployed -> Undeployed | ^ V | DeployFailed -------------------
      See Also:
    • EXCEPTION_LOADING_ENTITY_CLASS

      public static final String EXCEPTION_LOADING_ENTITY_CLASS
      See Also:
    • connectionPropertyNames

      public static String[] connectionPropertyNames
    • compositeEmSetupImpl

      protected EntityManagerSetupImpl compositeEmSetupImpl
    • compositeMemberEmSetupImpls

      protected Set<EntityManagerSetupImpl> compositeMemberEmSetupImpls
    • isMetadataExpired

      protected 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
    • persistenceException

      protected PersistenceException persistenceException
  • Constructor Details

    • EntityManagerSetupImpl

      public EntityManagerSetupImpl(String persistenceUnitUniqueName, String sessionName)
    • EntityManagerSetupImpl

      public EntityManagerSetupImpl()
  • Method Details

    • addFileSeperator

      protected static String addFileSeperator(String appLocation)
    • getOrBuildSessionName

      public static String getOrBuildSessionName(Map properties, PersistenceUnitInfo puInfo, String persistenceUnitUniqueName)
    • buildSessionNameSuffixFromConnectionProperties

      protected static String buildSessionNameSuffixFromConnectionProperties(Map properties)
    • changeSessionName

      public void changeSessionName(String newSessionName)
    • removeSessionFromGlobalSessionManager

      protected void removeSessionFromGlobalSessionManager()
      This method can be used to ensure the session represented by emSetupImpl is removed from the SessionManager.
    • deploy

      public AbstractSession deploy(ClassLoader realClassLoader, Map additionalProperties)
      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

      protected PersistenceException createDeployFailedPersistenceException(Throwable ex)
    • addProjectToSession

      protected void addProjectToSession(ServerSession session, Project project)
      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

      protected boolean updateServerPlatform(Map m, ClassLoader loader)
      Updates the EclipseLink ServerPlatform class for use with this platform.
      Returns:
      true if the ServerPlatform has changed.
    • updatePartitioning

      protected void updatePartitioning(Map m, ClassLoader loader)
      Checks for partitioning properties.
    • updateRemote

      protected void updateRemote(Map m, ClassLoader loader)
      Checks for partitioning properties.
    • updateDatabaseEventListener

      protected void updateDatabaseEventListener(Map m, ClassLoader loader)
      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 map
      serverPlatformChanged - the boolean that denotes a serverPlatform change in the session.
    • updateProfiler

      protected void updateProfiler(Map persistenceProperties, ClassLoader loader)
      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
      Throws:
      ClassNotFoundException
      PrivilegedActionException
    • findClassForProperty

      protected static <T> Class<T> findClassForProperty(String className, String propertyName, ClassLoader loader)
    • getStructConverters

      protected List<StructConverter> getStructConverters(ClassLoader realClassLoader)
      Internal: Returns a list of StructConverter instances from a list of StructConverter names stored within the project.
    • hasSchemaDatabaseGeneration

      protected boolean hasSchemaDatabaseGeneration(Map m)
    • hasSchemaScriptsGeneration

      protected boolean hasSchemaScriptsGeneration(Map m)
    • getSession

      public AbstractSession getSession()
    • getDatabaseSession

      public DatabaseSessionImpl getDatabaseSession()
    • getDatabaseSession

      public DatabaseSessionImpl getDatabaseSession(Map props)
      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.
      Throws:
      IllegalAccessException
      PrivilegedActionException
      InstantiationException
    • updateDescriptorCacheSettings

      protected void updateDescriptorCacheSettings(Map m, ClassLoader loader)
    • updateConnectionSettings

      protected void updateConnectionSettings(ServerSession serverSession, Map properties)
      Process all properties under "eclipselink.connection-pool.". This allows for named connection pools. It also processes "read", "write", "default" and "sequence" connection pools.
    • updateConnectionPolicy

      protected void updateConnectionPolicy(ServerSession serverSession, Map m)
    • getConnectionPolicyExclusiveModeFromProperties

      public static ConnectionPolicy.ExclusiveMode getConnectionPolicyExclusiveModeFromProperties(Map m, AbstractSession abstractSession, boolean useSystemAsDefault)
    • predeploy

      public ClassTransformer predeploy(PersistenceUnitInfo info, Map extendedProperties)
      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

      protected PersistenceException createPredeployFailedPersistenceException(Throwable ex)
    • getDeployedSessionName

      public String 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

      public PersistenceUnitInfo getPersistenceUnitInfo()
    • isValidationOnly

      public boolean isValidationOnly(Map m)
    • isValidationOnly

      protected boolean isValidationOnly(Map m, boolean shouldMergeMap)
    • shouldGetSessionOnCreateFactory

      public boolean shouldGetSessionOnCreateFactory(Map m)
      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

      protected Map mergeWithExistingMap(Map m)
    • isInContainerMode

      public boolean isInContainerMode()
    • updateCacheCoordination

      protected void updateCacheCoordination(Map m, ClassLoader loader)
      Configure cache coordination using properties.
    • updateSerializer

      protected void updateSerializer(Map m, ClassLoader loader)
      Update session serializer.
    • updateShouldOptimizeResultSetAccess

      protected void updateShouldOptimizeResultSetAccess(Map m)
      Update whether session ShouldOptimizeResultSetAccess.
    • updateTenancy

      protected void updateTenancy(Map m, ClassLoader loader)
      Update whether session should use externally defined multi tenancy.
    • updateTolerateInvalidJPQL

      protected void updateTolerateInvalidJPQL(Map m)
      Update whether session should tolerate invalid JPQL at creation time.
    • updateLogins

      protected void updateLogins(Map m)
      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

      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. This method gets those properties and sets them on the login.
    • updatePools

      protected void updatePools(ServerSession serverSession, Map m)
      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

      protected void updateSession(Map m, ClassLoader loader)
      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

      protected void processSessionCustomizer(Map m, ClassLoader loader)
    • initOrUpdateLogging

      protected void initOrUpdateLogging(Map m, SessionLog log)
    • processDescriptorCustomizers

      protected void processDescriptorCustomizers(Map m, ClassLoader loader)
    • 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

      public String getPersistenceUnitUniqueName()
    • getFactoryCount

      public int getFactoryCount()
    • getSessionName

      public String getSessionName()
    • shouldRedeploy

      public boolean shouldRedeploy()
    • shouldSendMetadataRefreshCommand

      public boolean shouldSendMetadataRefreshCommand(Map m)
      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

      protected void setSessionEventListener(Map m, ClassLoader loader)
      Allow customized session event listener to be added into session. The method needs to be called in deploy stage.
    • setExceptionHandler

      protected void setExceptionHandler(Map m, ClassLoader loader)
      Allow customized exception handler to be added into session. The method needs to be called in deploy and pre-deploy stage.
    • updateBatchWritingSetting

      protected void updateBatchWritingSetting(Map persistenceProperties, ClassLoader loader)
      Update batch writing setting. The method needs to be called in deploy stage.
    • updateMetadataRepository

      protected void updateMetadataRepository(Map m, ClassLoader loader)
      Load the Metadata Repository for Extensibility
    • updateTunerPreDeploy

      protected void updateTunerPreDeploy(Map m, ClassLoader loader)
      Check for a tuning property and run the tuner preDeploy.
    • updateTunerDeploy

      protected void updateTunerDeploy(Map m, ClassLoader loader)
      Check for a tuning property and run the tuner deploy.
    • updateTunerPostDeploy

      protected void updateTunerPostDeploy(Map m, ClassLoader loader)
      Check for a tuning property and run the tuner deploy.
    • updateFreeMemory

      protected void updateFreeMemory(Map m)
      Allow the deployment metadata to be freed post-deploy to conserve memory.
    • updateNativeSQLSetting

      protected void updateNativeSQLSetting(Map m)
      Enable or disable the capability of Native SQL function. The method needs to be called in deploy stage.
    • updateSequencing

      protected void updateSequencing(Map m)
      Configure sequencing settings.
    • updateSequencingStart

      protected void updateSequencingStart(Map m)
    • updateProjectCache

      protected void updateProjectCache(Map m, ClassLoader loader)
      Load the projectCacheAccessor for JPA project caching
    • updateJPQLParser

      protected void updateJPQLParser(Map m)
      Enable or disable the capability of Native SQL function. The method needs to be called in deploy stage.
    • updateAllowNativeSQLQueriesSetting

      protected void updateAllowNativeSQLQueriesSetting(Map m)
      Enable or disable the capability of Native SQL function. The method needs to be called in deploy stage.
    • updateSQLCastSetting

      protected void updateSQLCastSetting(Map m)
      Enable or disable SQL casting.
    • updateUppercaseSetting

      protected void updateUppercaseSetting(Map m)
      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

      protected void updatePessimisticLockTimeout(Map persistenceProperties)
      Update the default pessimistic lock timeout value.
      Parameters:
      persistenceProperties - the properties map
    • updatePessimisticLockTimeoutUnit

      protected void updatePessimisticLockTimeoutUnit(Map persistenceProperties)
      Update the default pessimistic lock timeout unit value.
      Parameters:
      persistenceProperties - the properties map
    • updateCacheStatementSettings

      protected void updateCacheStatementSettings(Map m)
      Enable or disable statements cached, update statements cache size. The method needs to be called in deploy stage.
    • updateAllowZeroIdSetting

      protected void updateAllowZeroIdSetting(Map m)
      Enable or disable default allowing 0 as an id.
    • updateIdValidation

      protected void updateIdValidation(Map m)
      Enable or disable default allowing 0 as an id.
    • updateSharedCacheMode

      protected void updateSharedCacheMode(Map m)
      Sets the SharedCacheMode with values from the jakarta.persistence.sharedCache.mode property. If user enters an invalid caching type, valueOf will throw an illegal argument exception, e.g. java.lang.IllegalArgumentException: No enum const class jakarta.persistence.SharedCacheMode.ALLBOGUS
    • updateTableCreationSettings

      protected void updateTableCreationSettings(Map m)
      sets the TABLE_CREATION_SUFFIX property on the session's project to be applied to all table creation statements (DDL)
    • updateIndexForeignKeys

      protected void updateIndexForeignKeys(Map m)
      Sets shouldCreateIndicesOnForeignKeys DDL generation option.
    • updateTemporalMutableSetting

      protected void updateTemporalMutableSetting(Map m)
      Enable or disable default temporal mutable setting. The method needs to be called in deploy stage.
    • setDescriptorNamedQueries

      protected void setDescriptorNamedQueries(Map m)
      Copy named queries defined in EclipseLink descriptor into the session if it was indicated to do so.
    • updateAllowExtendedCacheLogging

      protected void updateAllowExtendedCacheLogging(Map m)
      Enable or disable extended logging of JPA L2 cache usage. The method needs to be called in deploy stage.
    • updateAllowExtendedThreadLogging

      protected void updateAllowExtendedThreadLogging(Map m)
      Enable or disable extended thread logging. The method needs to be called in deploy stage.
    • updateAllowExtendedThreadLoggingThreadDump

      protected void updateAllowExtendedThreadLoggingThreadDump(Map m)
      Enable or disable thread dump addition to extended thread logging. The method needs to be called in deploy stage.
    • updateAllowQueryResultsCacheValidation

      protected void updateAllowQueryResultsCacheValidation(Map m)
      Enable or disable query result cache validation. The method needs to be called in deploy stage.
    • getMetamodel

      public Metamodel getMetamodel(ClassLoader classLoader)
      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

      protected void initializeCanonicalMetamodel(Metamodel model)
      INTERNAL: Initialize the Canonical Metamodel classes generated by EclipseLink
      Since:
      Java Persistence 2.0
    • setMetamodel

      public void setMetamodel(Metamodel aMetamodel)
      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

      public static boolean mustBeCompositeMember(PersistenceUnitInfo puInfo)
    • isComposite

      public static boolean isComposite(PersistenceUnitInfo puInfo)
    • setCompositeEmSetupImpl

      public void setCompositeEmSetupImpl(EntityManagerSetupImpl compositeEmSetupImpl)
    • getCompositeEmSetupImpl

      public EntityManagerSetupImpl getCompositeEmSetupImpl()
    • setStaticWeaveInfo

      public void setStaticWeaveInfo(StaticWeaveInfo staticWeaveInfo)
    • predeployCompositeMembers

      protected void predeployCompositeMembers(Map predeployProperties, ClassLoader tempClassLoader)
    • deployCompositeMembers

      protected void deployCompositeMembers(Map deployProperties, ClassLoader realClassLoader)
    • 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

      public void preInitializeCanonicalMetamodel(EntityManagerFactoryImpl factory)
      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

      protected void updateCompositeMembersProperties(Map compositeProperties)
    • updateCompositeMembersProperties

      protected void updateCompositeMembersProperties(Set<SEPersistenceUnitInfo> compositePuInfos, Map compositeProperties)
    • overrideMemberProperties

      protected static void overrideMemberProperties(Map memberProperties, Map compositeProperties)
    • 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

      public EntityManagerSetupImpl refreshMetadata(Map properties)
      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

      public 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. This method satisfies the MetedataRefreshListener implementation and is called by incoming RCM refresh commands
      Specified by:
      triggerMetadataRefresh in interface MetadataRefreshListener
      See Also:
    • writeDDL

      public void writeDDL(Map props, DatabaseSessionImpl session, ClassLoader classLoader)
      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)
    • 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.