Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa

public Class EntityManagerFactoryImpl

extends Object
implements EntityManagerFactory, PersistenceUnitUtil, JpaEntityManagerFactory
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.JpaEntityManagerFactory, java.lang.AutoCloseable, jakarta.persistence.EntityManagerFactory, jakarta.persistence.PersistenceUnitUtil, jakarta.persistence.PersistenceUtil
Imports
java.util.HashMap, .Iterator, .List, .Map, jakarta.persistence.Cache, .EntityGraph, .EntityManager, .EntityManagerFactory, .FlushModeType, .PersistenceException, .PersistenceUnitUtil, .Query, .SynchronizationType, jakarta.persistence.criteria.CriteriaBuilder, jakarta.persistence.metamodel.Metamodel, org.eclipse.persistence.config.ReferenceMode, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.PersistenceUnitLoadingException, org.eclipse.persistence.internal.indirection.IndirectionPolicy, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.internal.sessions.AbstractSession, .DatabaseSessionImpl, org.eclipse.persistence.internal.sessions.coordination.MetadataRefreshCommand, org.eclipse.persistence.jpa.JpaEntityManagerFactory, org.eclipse.persistence.mappings.DatabaseMapping, .ForeignReferenceMapping, org.eclipse.persistence.queries.AttributeGroup, .DatabaseQuery, .FetchGroupTracker, .ObjectLevelReadQuery, .ReadQuery, org.eclipse.persistence.sessions.DatabaseSession, .Session, .UnitOfWork.CommitOrderType, org.eclipse.persistence.sessions.broker.SessionBroker, org.eclipse.persistence.sessions.coordination.CommandManager, org.eclipse.persistence.sessions.factories.SessionManager, org.eclipse.persistence.sessions.server.Server, .ServerSession

Wraps our implementation of EntityManagerFactory Most operations are forwarded to the delegate. This wrapper is used to enable the refreshMetadata functionality which allows you to switch the underlying metadata for an EMF after deploy time.
Author
tware

Field Summary

Modifier and TypeField and Description
protected EntityManagerFactoryDelegate

Constructor Summary

AccessConstructor and Description
public
EntityManagerFactoryImpl(AbstractSession serverSession)

Will return an instance of the Factory.

public
public
EntityManagerFactoryImpl(String persistenceUnitName, Map<String, Object> properties, List<ClassDescriptor> descriptors)

Create a dynamic persistence unit which does not use the persistence.xml.

Method Summary

Modifier and TypeMethod and Description
public <T> void
addNamedEntityGraph(String
name for the entity graph
graphName
,
EntityGraph<T>
entity graph
entityGraph
)

Implements jakarta.persistence.EntityManagerFactory.addNamedEntityGraph.

Add a named copy of the EntityGraph to the EntityManagerFactory.
public void
addNamedQuery(String
name for the query
name
,
Query
Query, TypedQuery, or StoredProcedureQuery object
query
)

Implements jakarta.persistence.EntityManagerFactory.addNamedQuery.

Define the query, typed query, or stored procedure query as a named query such that future query objects can be created from it using the createNamedQuery or createNamedStoredProcedureQuery method.
public synchronized void
close()

Implements jakarta.persistence.EntityManagerFactory.close, java.lang.AutoCloseable.close.

Closes this factory, releasing any resources that might be held by this factory.
public EntityManager
createEntityManager()

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

PUBLIC: Returns an EntityManager for this deployment.
public EntityManager
createEntityManager(Map<K, V>
properties for entity manager
properties
)

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

PUBLIC: Returns an EntityManager for this deployment.
public EntityManager
createEntityManager(SynchronizationType
how and when the entity manager should be synchronized with the current JTA transaction
synchronizationType
)

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

Create a new JTA application-managed EntityManager with the specified synchronization type.
public EntityManager
createEntityManager(SynchronizationType
how and when the entity manager should be synchronized with the current JTA transaction
synchronizationType
,
Map<K, V>
properties for entity manager
map
)

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

Create a new JTA application-managed EntityManager with the specified synchronization type and map of properties.
protected EntityManagerImpl
createEntityManagerImpl(Map<K, V> properties, SynchronizationType syncType)

public boolean
getBeginEarlyTransaction()

Return default join existing transaction property, allows reading through write connection.

public Cache

Returns:

instance of the Cache interface
getCache
()

Implements jakarta.persistence.EntityManagerFactory.getCache.

Access the cache that is associated with the entity manager factory (the "second level cache").
public boolean
getCloseOnCommit()

Return default property to avoid resuming unit of work if going to be closed on commit anyway.

public UnitOfWork.CommitOrderType
getCommitOrder()

Return if updates should be ordered by primary key to avoid possible database deadlocks.

public boolean
getCommitWithoutPersistRules()

Return default property to avoid discover new objects in unit of work if application always uses persist.

public CriteriaBuilder
getCriteriaBuilder()

Implements jakarta.persistence.EntityManagerFactory.getCriteriaBuilder.

Return an instance of CriteriaBuilder for the creation of CriteriaQuery objects.
public DatabaseSessionImpl
getDatabaseSession()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.getDatabaseSession.

Returns the DatabaseSession that the Factory will be using and initializes it if it is not available.
public String
getFlushClearCache()

Return the default FlashClearCache mode to be used.

public FlushModeType
getFlushMode()

Return default property, allows flush before query to be avoided.

public static Object

Returns:

id of the entity
getIdentifier
(Object entity, AbstractSession session)

Returns the id of the entity.

public Object

Returns:

id of the entity
getIdentifier
(Object
entity instance
entity
)

Implements jakarta.persistence.PersistenceUnitUtil.getIdentifier.

Returns the id of the entity.
public Metamodel

Returns:

Metamodel instance
getMetamodel
()

Implements jakarta.persistence.EntityManagerFactory.getMetamodel.

Return an instance of Metamodel interface for access to the metamodel of the persistence unit.
public PersistenceUnitUtil

Returns:

PersistenceUnitUtil interface
getPersistenceUnitUtil
()

Implements jakarta.persistence.EntityManagerFactory.getPersistenceUnitUtil.

Return interface providing access to utility methods for the persistence unit.
public boolean
getPersistOnCommit()

Return default property to avoid discover new objects in unit of work if application always uses persist.

public Map<String, Object>
getProperties()

Implements jakarta.persistence.EntityManagerFactory.getProperties.

Get the properties and associated values that are in effect for the entity manager factory.
public Object
getProperty(String name)

The method return user defined property passed in from EntityManagerFactory.

public ReferenceMode
getReferenceMode()

Return default property, allows weak unit of work references.

public ServerSession
getServerSession()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.getServerSession.

INTERNAL: Returns the ServerSession that the Factory will be using and initializes it if it is not available.
public SessionBroker
getSessionBroker()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.getSessionBroker.

INTERNAL: Returns the SessionBroker that the Factory will be using and initializes it if it is not available.
public static Boolean

Returns:

false if the entity has not been loaded, else true.
isLoaded
(Object
whose load state is to be determined
entity
,
AbstractSession session)

Determine the load state of an entity belonging to the persistence unit.

public static Boolean

Returns:

false if entity's state has not been loaded or if the attribute state has not been loaded, otherwise true
isLoaded
(Object
containing the attribute
entity
,
String
name of attribute whose load state is to be determined
attributeName
,
AbstractSession session)

Determine the load state of a given persistent attribute of an entity belonging to the persistence unit.

public static boolean
isLoaded(Object entity, String attributeName, DatabaseMapping mapping)

Check whether a named attribute on a given entity with a given mapping has been loaded.

public boolean

Returns:

false if entity's state has not been loaded or if the attribute state has not been loaded, otherwise true
isLoaded
(Object
containing the attribute
entity
,
String
name of attribute whose load state is to be determined
attributeName
)

Implements jakarta.persistence.PersistenceUnitUtil.isLoaded.

Determine the load state of a given persistent attribute of an entity belonging to the persistence unit.
public boolean

Returns:

false if the entity has not been loaded, else true.
isLoaded
(Object
whose load state is to be determined
entity
)

Implements jakarta.persistence.PersistenceUnitUtil.isLoaded.

Determine the load state of an entity belonging to the persistence unit.
public boolean
isOpen()

Implements jakarta.persistence.EntityManagerFactory.isOpen.

Indicates whether or not this factory is open.
public void
refreshMetadata(Map<String, Object> properties)

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.refreshMetadata.

ADVANCED: Re-bootstrap this factory.
public void
setBeginEarlyTransaction(boolean beginEarlyTransaction)

Set default join existing transaction property, allows reading through write connection.

public void
setCloseOnCommit(boolean closeOnCommit)

Set default property to avoid resuming unit of work if going to be closed on commit anyway.

public void
setCommitOrder(UnitOfWork.CommitOrderType commitOrder)

Set updates should be ordered by primary key to avoid possible database deadlocks.

public void
setCommitWithoutPersistRules(boolean commitWithoutPersistRules)

Set default property to avoid discover new objects in unit of work if application always uses persist.

public void
setFlushClearCache(String flushClearCache)

Set the default FlashClearCache mode to be used.

public void
setFlushMode(FlushModeType flushMode)

Set default property, allows flush before query to be avoided.

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.

public void
setPersistOnCommit(boolean persistOnCommit)

Set default property to avoid discover new objects in unit of work if application always uses persist.

public void
setReferenceMode(ReferenceMode referenceMode)

Set default property, allows weak unit of work references.

public void
setShouldValidateExistence(boolean shouldValidateExistence)

Set the default to determine if does-exist should be performed on persist.

public boolean
shouldValidateExistence()

Return the default to determine if does-exist should be performed on persist.

public EntityManagerFactoryDelegate
unwrap()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.unwrap.

Gets the underlying implementation of the EntityManagerFactory.
public <T> T
unwrap(Class<T>
the class of the object to be returned. This is normally either the underlying EntityManagerFactory implementation class or an interface that it implements.
cls
)

Implements jakarta.persistence.EntityManagerFactory.unwrap.

Return an object of the specified type to allow access to the provider-specific API.
protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
protected EntityManagerFactoryDelegate delegate

Constructor Detail

EntityManagerFactoryImplback to summary
public EntityManagerFactoryImpl(AbstractSession serverSession)

Will return an instance of the Factory. Should only be called by EclipseLink.

EntityManagerFactoryImplback to summary
public EntityManagerFactoryImpl(EntityManagerSetupImpl setupImpl, Map<K, V> properties)
EntityManagerFactoryImplback to summary
public EntityManagerFactoryImpl(String persistenceUnitName, Map<String, Object> properties, List<ClassDescriptor> descriptors)

Create a dynamic persistence unit which does not use the persistence.xml. Instead all configuration is driven from the provided persistence unit properties and descriptors.

Method Detail

addNamedEntityGraphback to summary
public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph)

Implements jakarta.persistence.EntityManagerFactory.addNamedEntityGraph.

Doc from jakarta.persistence.EntityManagerFactory.addNamedEntityGraph.

Add a named copy of the EntityGraph to the EntityManagerFactory. If an entity graph with the same name already exists, it is replaced.

Parameters
graphName:String

name for the entity graph

entityGraph:EntityGraph<T>

entity graph

Annotations
@Override
addNamedQueryback to summary
public void addNamedQuery(String name, Query query)

Implements jakarta.persistence.EntityManagerFactory.addNamedQuery.

Doc from jakarta.persistence.EntityManagerFactory.addNamedQuery.

Define the query, typed query, or stored procedure query as a named query such that future query objects can be created from it using the createNamedQuery or createNamedStoredProcedureQuery method.

Any configuration of the query object (except for actual parameter binding) in effect when the named query is added is retained as part of the named query definition. This includes configuration information such as max results, hints, flush mode, lock mode, result set mapping information, and information about stored procedure parameters.

When the query is executed, information that can be set by means of the query APIs can be overridden. Information that is overridden does not affect the named query as registered with the entity manager factory, and thus does not affect subsequent query objects created from it by means of the createNamedQuery or createNamedStoredProcedureQuery method.

If a named query of the same name has been previously defined, either statically via metadata or via this method, that query definition is replaced.

Parameters
name:String

name for the query

query:Query

Query, TypedQuery, or StoredProcedureQuery object

Annotations
@Override
closeback to summary
public synchronized void close()

Implements jakarta.persistence.EntityManagerFactory.close, java.lang.AutoCloseable.close.

Closes this factory, releasing any resources that might be held by this factory. After invoking this method, all methods on the instance will throw an IllegalStateException, except for isOpen, which will return false.

Annotations
@Override
createEntityManagerback to summary
public EntityManager createEntityManager()

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

PUBLIC: Returns an EntityManager for this deployment.

Returns:EntityManager

Doc from jakarta.persistence.EntityManagerFactory.createEntityManager.

entity manager instance

Annotations
@Override
createEntityManagerback to summary
public EntityManager createEntityManager(Map<K, V> properties)

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

PUBLIC: Returns an EntityManager for this deployment.

Parameters
properties:Map<K, V>

Doc from jakarta.persistence.EntityManagerFactory.createEntityManager.

properties for entity manager

Returns:EntityManager

Doc from jakarta.persistence.EntityManagerFactory.createEntityManager.

entity manager instance

Annotations
@Override
createEntityManagerback to summary
public EntityManager createEntityManager(SynchronizationType synchronizationType)

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

Doc from jakarta.persistence.EntityManagerFactory.createEntityManager.

Create a new JTA application-managed EntityManager with the specified synchronization type. This method returns a new EntityManager instance each time it is invoked. The isOpen method will return true on the returned instance.

Parameters
synchronizationType:SynchronizationType

how and when the entity manager should be synchronized with the current JTA transaction

Returns:EntityManager

entity manager instance

Annotations
@Override
createEntityManagerback to summary
public EntityManager createEntityManager(SynchronizationType synchronizationType, Map<K, V> map)

Implements jakarta.persistence.EntityManagerFactory.createEntityManager.

Doc from jakarta.persistence.EntityManagerFactory.createEntityManager.

Create a new JTA application-managed EntityManager with the specified synchronization type and map of properties. This method returns a new EntityManager instance each time it is invoked. The isOpen method will return true on the returned instance.

Parameters
synchronizationType:SynchronizationType

how and when the entity manager should be synchronized with the current JTA transaction

map:Map<K, V>

properties for entity manager

Returns:EntityManager

entity manager instance

Annotations
@Override
createEntityManagerImplback to summary
protected EntityManagerImpl createEntityManagerImpl(Map<K, V> properties, SynchronizationType syncType)
getBeginEarlyTransactionback to summary
public boolean getBeginEarlyTransaction()

Return default join existing transaction property, allows reading through write connection.

getCacheback to summary
public Cache getCache()

Implements jakarta.persistence.EntityManagerFactory.getCache.

Access the cache that is associated with the entity manager factory (the "second level cache").

Returns:Cache

instance of the Cache interface

Annotations
@Override
Exceptions
IllegalStateException:
if the entity manager factory has been closed
Since
Java Persistence 2.0
See Also
jakarta.persistence.EntityManagerFactory#getCache()
getCloseOnCommitback to summary
public boolean getCloseOnCommit()

Return default property to avoid resuming unit of work if going to be closed on commit anyway.

getCommitOrderback to summary
public UnitOfWork.CommitOrderType getCommitOrder()

Return if updates should be ordered by primary key to avoid possible database deadlocks.

getCommitWithoutPersistRulesback to summary
public boolean getCommitWithoutPersistRules()

Return default property to avoid discover new objects in unit of work if application always uses persist.

getCriteriaBuilderback to summary
public CriteriaBuilder getCriteriaBuilder()

Implements jakarta.persistence.EntityManagerFactory.getCriteriaBuilder.

Doc from jakarta.persistence.EntityManagerFactory.getCriteriaBuilder.

Return an instance of CriteriaBuilder for the creation of CriteriaQuery objects.

Returns:CriteriaBuilder

CriteriaBuilder instance

Annotations
@Override
Since
Java Persistence 2.0
See Also
jakarta.persistence.EntityManagerFactory#getCriteriaBuilder()
getDatabaseSessionback to summary
public DatabaseSessionImpl getDatabaseSession()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.getDatabaseSession.

Doc from org.eclipse.persistence.jpa.JpaEntityManagerFactory.getDatabaseSession.

Returns the DatabaseSession that the Factory will be using and initializes it if it is not available.

Annotations
@Override
getFlushClearCacheback to summary
public String getFlushClearCache()

Return the default FlashClearCache mode to be used. Relevant only in case call to flush method followed by call to clear method.

See Also
org.eclipse.persistence.config.FlushClearCache
getFlushModeback to summary
public FlushModeType getFlushMode()

Return default property, allows flush before query to be avoided.

getIdentifierback to summary
public static Object getIdentifier(Object entity, AbstractSession session)

Returns the id of the entity. A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id

Returns:Object

id of the entity

Exceptions
IllegalArgumentException:
if the entity is found not to be an entity.
getIdentifierback to summary
public Object getIdentifier(Object entity)

Implements jakarta.persistence.PersistenceUnitUtil.getIdentifier.

Returns the id of the entity. A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id

Parameters
entity:Object

Doc from jakarta.persistence.PersistenceUnitUtil.getIdentifier.

entity instance

Returns:Object

id of the entity

Annotations
@Override
Exceptions
IllegalStateException:
if the entity is found not to be an entity.
getMetamodelback to summary
public Metamodel getMetamodel()

Implements jakarta.persistence.EntityManagerFactory.getMetamodel.

Return an instance of Metamodel interface for access to the metamodel of the persistence unit.

Returns:Metamodel

Metamodel instance

Annotations
@Override
Exceptions
IllegalStateException:
if the entity manager factory has been closed.
Since
Java Persistence 2.0
See Also
jakarta.persistence.EntityManagerFactory#getMetamodel()
getPersistenceUnitUtilback to summary
public PersistenceUnitUtil getPersistenceUnitUtil()

Implements jakarta.persistence.EntityManagerFactory.getPersistenceUnitUtil.

Return interface providing access to utility methods for the persistence unit.

Returns:PersistenceUnitUtil

PersistenceUnitUtil interface

Annotations
@Override
Exceptions
IllegalStateException:
if the entity manager factory has been closed.
getPersistOnCommitback to summary
public boolean getPersistOnCommit()

Return default property to avoid discover new objects in unit of work if application always uses persist.

getPropertiesback to summary
public Map<String, Object> getProperties()

Implements jakarta.persistence.EntityManagerFactory.getProperties.

Doc from jakarta.persistence.EntityManagerFactory.getProperties.

Get the properties and associated values that are in effect for the entity manager factory. Changing the contents of the map does not change the configuration in effect.

Returns:Map<String, Object>

properties

Annotations
@Override
Since
Java Persistence API 2.0
See Also
jakarta.persistence.EntityManagerFactory#getProperties()
getPropertyback to summary
public Object getProperty(String name)

The method return user defined property passed in from EntityManagerFactory.

getReferenceModeback to summary
public ReferenceMode getReferenceMode()

Return default property, allows weak unit of work references.

getServerSessionback to summary
public ServerSession getServerSession()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.getServerSession.

INTERNAL: Returns the ServerSession that the Factory will be using and initializes it if it is not available. This method makes use of the partially constructed session stored in our setupImpl and completes its construction

Annotations
@Override
getSessionBrokerback to summary
public SessionBroker getSessionBroker()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.getSessionBroker.

INTERNAL: Returns the SessionBroker that the Factory will be using and initializes it if it is not available. This method makes use of the partially constructed session stored in our setupImpl and completes its construction TODO: should throw IllegalStateException if not SessionBroker

Annotations
@Override
isLoadedback to summary
public static Boolean isLoaded(Object entity, AbstractSession session)

Determine the load state of an entity belonging to the persistence unit. This method can be used to determine the load state of an entity passed as a reference. An entity is considered loaded if all attributes for which FetchType EAGER has been specified have been loaded. The isLoaded(Object, String) method should be used to determine the load state of an attribute. Not doing so might lead to unintended loading of state.

Parameters
entity:Object

whose load state is to be determined

Returns:Boolean

false if the entity has not been loaded, else true.

isLoadedback to summary
public static Boolean isLoaded(Object entity, String attributeName, AbstractSession session)

Determine the load state of a given persistent attribute of an entity belonging to the persistence unit.

Parameters
entity:Object

containing the attribute

attributeName:String

name of attribute whose load state is to be determined

Returns:Boolean

false if entity's state has not been loaded or if the attribute state has not been loaded, otherwise true

isLoadedback to summary
public static boolean isLoaded(Object entity, String attributeName, DatabaseMapping mapping)

Check whether a named attribute on a given entity with a given mapping has been loaded. This method will check the valueholder or indirect collection for LAZY ForeignReferenceMappings to see if has been instantiated and otherwise check the fetch group.

isLoadedback to summary
public boolean isLoaded(Object entity, String attributeName)

Implements jakarta.persistence.PersistenceUnitUtil.isLoaded.

Determine the load state of a given persistent attribute of an entity belonging to the persistence unit.

Parameters
entity:Object

containing the attribute

attributeName:String

name of attribute whose load state is to be determined

Returns:boolean

false if entity's state has not been loaded or if the attribute state has not been loaded, otherwise true

Annotations
@Override
isLoadedback to summary
public boolean isLoaded(Object entity)

Implements jakarta.persistence.PersistenceUnitUtil.isLoaded.

Determine the load state of an entity belonging to the persistence unit. This method can be used to determine the load state of an entity passed as a reference. An entity is considered loaded if all attributes for which FetchType EAGER has been specified have been loaded. The isLoaded(Object, String) method should be used to determine the load state of an attribute. Not doing so might lead to unintended loading of state.

Parameters
entity:Object

whose load state is to be determined

Returns:boolean

false if the entity has not been loaded, else true.

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements jakarta.persistence.EntityManagerFactory.isOpen.

Indicates whether or not this factory is open. Returns true until a call to close is made.

Returns:boolean

Doc from jakarta.persistence.EntityManagerFactory.isOpen.

boolean indicating whether the factory is open

Annotations
@Override
refreshMetadataback to summary
public void refreshMetadata(Map<String, Object> properties)

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.refreshMetadata.

ADVANCED: Re-bootstrap this factory. This method will rebuild the EntityManagerFactory. It should be used in conjunction with a MetadataSource to allow mappings to be changed in a running system. All existing EntityMangers will continue to function with the old metadata, but new factories will use the new metadata.

Annotations
@Override
setBeginEarlyTransactionback to summary
public void setBeginEarlyTransaction(boolean beginEarlyTransaction)

Set default join existing transaction property, allows reading through write connection.

setCloseOnCommitback to summary
public void setCloseOnCommit(boolean closeOnCommit)

Set default property to avoid resuming unit of work if going to be closed on commit anyway.

setCommitOrderback to summary
public void setCommitOrder(UnitOfWork.CommitOrderType commitOrder)

Set updates should be ordered by primary key to avoid possible database deadlocks.

setCommitWithoutPersistRulesback to summary
public void setCommitWithoutPersistRules(boolean commitWithoutPersistRules)

Set default property to avoid discover new objects in unit of work if application always uses persist.

setFlushClearCacheback to summary
public void setFlushClearCache(String flushClearCache)

Set the default FlashClearCache mode to be used. Relevant only in case call to flush method followed by call to clear method.

See Also
org.eclipse.persistence.config.FlushClearCache
setFlushModeback to summary
public void setFlushMode(FlushModeType flushMode)

Set default property, allows flush before query to be avoided.

setMetamodelback to summary
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
setPersistOnCommitback to summary
public void setPersistOnCommit(boolean persistOnCommit)

Set default property to avoid discover new objects in unit of work if application always uses persist.

setReferenceModeback to summary
public void setReferenceMode(ReferenceMode referenceMode)

Set default property, allows weak unit of work references.

setShouldValidateExistenceback to summary
public void setShouldValidateExistence(boolean shouldValidateExistence)

Set the default to determine if does-exist should be performed on persist.

shouldValidateExistenceback to summary
public boolean shouldValidateExistence()

Return the default to determine if does-exist should be performed on persist.

unwrapback to summary
public EntityManagerFactoryDelegate unwrap()

Implements org.eclipse.persistence.jpa.JpaEntityManagerFactory.unwrap.

Gets the underlying implementation of the EntityManagerFactory. This method will return a version of EntityManagerFactory that is based on the available metadata at the time it is called. Future calls to refresh will not affect that metadata on this EntityManagerFactory.

Annotations
@Override
unwrapback to summary
public <T> T unwrap(Class<T> cls)

Implements jakarta.persistence.EntityManagerFactory.unwrap.

Doc from jakarta.persistence.EntityManagerFactory.unwrap.

Return an object of the specified type to allow access to the provider-specific API. If the provider's EntityManagerFactory implementation does not support the specified class, the PersistenceException is thrown.

Parameters
cls:Class<T>

the class of the object to be returned. This is normally either the underlying EntityManagerFactory implementation class or an interface that it implements.

Returns:T

an instance of the specified class

Annotations
@Override
verifyOpenback to summary
protected void verifyOpen()