| Modifier and Type | Field and Description |
|---|---|
| protected EntityManagerFactoryDelegate |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | EntityManagerFactoryImpl(String persistenceUnitName, Map<String, Object> properties, List<ClassDescriptor> descriptors)
Create a dynamic persistence unit which does not use the persistence.xml. |
| Modifier and Type | Method and Description |
|---|---|
| public <T> void | addNamedEntityGraph(String
name for the entity graph graphName, EntityGraph<T> entity graph entityGraph)Implements jakarta. |
| public void | addNamedQuery(String
name for the query name, Query Query, TypedQuery, or StoredProcedureQuery object query)Implements jakarta. createNamedQuery or
createNamedStoredProcedureQuery method.
|
| public synchronized void | close()
Implements jakarta. |
| public EntityManager | createEntityManager()
Implements jakarta. |
| public EntityManager | createEntityManager(Map<K, V>
properties for entity manager properties)Implements jakarta. |
| public EntityManager | createEntityManager(SynchronizationType
how and when the entity manager should be
synchronized with the current JTA transaction synchronizationType)Implements jakarta. 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. EntityManager with the
specified synchronization type and map of properties.
|
| protected EntityManagerImpl | |
| public boolean | getBeginEarlyTransaction()
Return default join existing transaction property, allows reading through write connection. |
| public Cache | Returns: instance of theCache interfaceImplements jakarta. |
| public boolean | getCloseOnCommit()
Return default property to avoid resuming unit of work if going to be closed on commit anyway. |
| public UnitOfWork. | 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. CriteriaBuilder for the creation of
CriteriaQuery objects.
|
| public DatabaseSessionImpl | getDatabaseSession()
Implements org. |
| public String | |
| public FlushModeType | |
| public static Object | Returns: id of the entityReturns the id of the entity. |
| public Object | Returns: id of the entityentity instance entity)Implements jakarta. |
| public Metamodel | Returns: Metamodel instanceImplements jakarta. |
| public PersistenceUnitUtil | Returns: PersistenceUnitUtil interfaceImplements jakarta. |
| public boolean | getPersistOnCommit()
Return default property to avoid discover new objects in unit of work if application always uses persist. |
| public Map | getProperties()
Implements jakarta. |
| public Object | getProperty(String name)
The method return user defined property passed in from EntityManagerFactory. |
| public ReferenceMode | |
| public ServerSession | getServerSession()
Implements org. |
| public SessionBroker | getSessionBroker()
Implements org. |
| public static Boolean | Returns: false if the entity has not been loaded, else true.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 truecontaining 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 truecontaining the attribute entity, String name of attribute whose load state is to be determined attributeName)Implements jakarta. |
| public boolean | Returns: false if the entity has not been loaded, else true.whose load state is to be determined entity)Implements jakarta. |
| public boolean | isOpen()
Implements jakarta. |
| public void | refreshMetadata(Map<String, Object> properties)
Implements org. |
| 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.
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 | |
| public void | |
| 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. |
| 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. |
| protected void |
| delegate | back to summary |
|---|---|
| protected EntityManagerFactoryDelegate delegate | |
| EntityManagerFactoryImpl | back to summary |
|---|---|
| public EntityManagerFactoryImpl(AbstractSession serverSession) Will return an instance of the Factory. Should only be called by EclipseLink. | |
| EntityManagerFactoryImpl | back to summary |
|---|---|
| public EntityManagerFactoryImpl(EntityManagerSetupImpl setupImpl, Map<K, V> properties) | |
| EntityManagerFactoryImpl | back 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. | |
| addNamedEntityGraph | back to summary |
|---|---|
| public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph) Implements jakarta. Doc from jakarta. Add a named copy of the EntityGraph to the EntityManagerFactory. If an entity graph with the same name already exists, it is replaced.
| |
| addNamedQuery | back to summary |
|---|---|
| public void addNamedQuery(String name, Query query) Implements jakarta. Doc from jakarta. 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 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 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. | |
| close | back to summary |
|---|---|
| public synchronized void close() Implements jakarta. 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
| |
| createEntityManager | back to summary |
|---|---|
| public EntityManager createEntityManager() Implements jakarta. PUBLIC: Returns an EntityManager for this deployment.
| |
| createEntityManager | back to summary |
|---|---|
| public EntityManager createEntityManager(Map<K, V> properties) Implements jakarta. PUBLIC: Returns an EntityManager for this deployment.
| |
| createEntityManager | back to summary |
|---|---|
| public EntityManager createEntityManager(SynchronizationType synchronizationType) Implements jakarta. Doc from jakarta. Create a new JTA application-managed
| |
| createEntityManager | back to summary |
|---|---|
| public EntityManager createEntityManager(SynchronizationType synchronizationType, Map<K, V> map) Implements jakarta. Doc from jakarta. Create a new JTA application-managed
| |
| createEntityManagerImpl | back to summary |
|---|---|
| protected EntityManagerImpl createEntityManagerImpl(Map<K, V> properties, SynchronizationType syncType) | |
| getBeginEarlyTransaction | back to summary |
|---|---|
| public boolean getBeginEarlyTransaction() Return default join existing transaction property, allows reading through write connection. | |
| getCache | back to summary |
|---|---|
| public Cache getCache() Implements jakarta. Access the cache that is associated with the entity manager factory (the "second level cache").
| |
| getCloseOnCommit | back to summary |
|---|---|
| public boolean getCloseOnCommit() Return default property to avoid resuming unit of work if going to be closed on commit anyway. | |
| getCommitOrder | back to summary |
|---|---|
| public UnitOfWork. Return if updates should be ordered by primary key to avoid possible database deadlocks. | |
| getCommitWithoutPersistRules | back to summary |
|---|---|
| public boolean getCommitWithoutPersistRules() Return default property to avoid discover new objects in unit of work if application always uses persist. | |
| getCriteriaBuilder | back to summary |
|---|---|
| public CriteriaBuilder getCriteriaBuilder() Implements jakarta. Doc from jakarta. Return an instance of
| |
| getDatabaseSession | back to summary |
|---|---|
| public DatabaseSessionImpl getDatabaseSession() Implements org. Doc from org. Returns the DatabaseSession that the Factory will be using and initializes it if it is not available.
| |
| getFlushClearCache | back 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. | |
| getFlushMode | back to summary |
|---|---|
| public FlushModeType getFlushMode() Return default property, allows flush before query to be avoided. | |
| getIdentifier | back 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
| |
| getIdentifier | back to summary |
|---|---|
| public Object getIdentifier(Object entity) Implements jakarta. 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
| |
| getMetamodel | back to summary |
|---|---|
| public Metamodel getMetamodel() Implements jakarta. Return an instance of Metamodel interface for access to the metamodel of the persistence unit.
| |
| getPersistenceUnitUtil | back to summary |
|---|---|
| public PersistenceUnitUtil getPersistenceUnitUtil() Implements jakarta. Return interface providing access to utility methods for the persistence unit.
| |
| getPersistOnCommit | back to summary |
|---|---|
| public boolean getPersistOnCommit() Return default property to avoid discover new objects in unit of work if application always uses persist. | |
| getProperties | back to summary |
|---|---|
| public Map Implements jakarta. Doc from jakarta. 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.
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) The method return user defined property passed in from EntityManagerFactory. | |
| getReferenceMode | back to summary |
|---|---|
| public ReferenceMode getReferenceMode() Return default property, allows weak unit of work references. | |
| getServerSession | back to summary |
|---|---|
| public ServerSession getServerSession() Implements org. 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
| |
| getSessionBroker | back to summary |
|---|---|
| public SessionBroker getSessionBroker() Implements org. 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
| |
| isLoaded | back 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. | |
| isLoaded | back 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. | |
| isLoaded | back 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. | |
| isLoaded | back to summary |
|---|---|
| public boolean isLoaded(Object entity, String attributeName) Implements jakarta. Determine the load state of a given persistent attribute of an entity belonging to the persistence unit. | |
| isLoaded | back to summary |
|---|---|
| public boolean isLoaded(Object entity) Implements jakarta. 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. | |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements jakarta. Indicates whether or not this factory is open. Returns
| |
| refreshMetadata | back to summary |
|---|---|
| public void refreshMetadata(Map<String, Object> properties) Implements org. 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.
| |
| setBeginEarlyTransaction | back to summary |
|---|---|
| public void setBeginEarlyTransaction(boolean beginEarlyTransaction) Set default join existing transaction property, allows reading through write connection. | |
| setCloseOnCommit | back to summary |
|---|---|
| public void setCloseOnCommit(boolean closeOnCommit) Set default property to avoid resuming unit of work if going to be closed on commit anyway. | |
| setCommitOrder | back to summary |
|---|---|
| public void setCommitOrder(UnitOfWork. Set updates should be ordered by primary key to avoid possible database deadlocks. | |
| setCommitWithoutPersistRules | back to summary |
|---|---|
| public void setCommitWithoutPersistRules(boolean commitWithoutPersistRules) Set default property to avoid discover new objects in unit of work if application always uses persist. | |
| setFlushClearCache | back 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. | |
| setFlushMode | back to summary |
|---|---|
| public void setFlushMode(FlushModeType flushMode) Set default property, allows flush before query to be avoided. | |
| setMetamodel | back 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.
| |
| setPersistOnCommit | back to summary |
|---|---|
| public void setPersistOnCommit(boolean persistOnCommit) Set default property to avoid discover new objects in unit of work if application always uses persist. | |
| setReferenceMode | back to summary |
|---|---|
| public void setReferenceMode(ReferenceMode referenceMode) Set default property, allows weak unit of work references. | |
| setShouldValidateExistence | back to summary |
|---|---|
| public void setShouldValidateExistence(boolean shouldValidateExistence) Set the default to determine if does-exist should be performed on persist. | |
| shouldValidateExistence | back to summary |
|---|---|
| public boolean shouldValidateExistence() Return the default to determine if does-exist should be performed on persist. | |
| unwrap | back to summary |
|---|---|
| public EntityManagerFactoryDelegate unwrap() Implements org. 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.
| |
| unwrap | back to summary |
|---|---|
| public <T> T unwrap(Class<T> cls) Implements jakarta. Doc from jakarta. 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. | |
| verifyOpen | back to summary |
|---|---|
| protected void verifyOpen() | |