Package net.officefloor.jpa.datanucleus
Class DataNucleusJpaManagedObjectSource
java.lang.Object
net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<Indexed,None>
net.officefloor.jpa.JpaManagedObjectSource
net.officefloor.jpa.datanucleus.DataNucleusJpaManagedObjectSource
- All Implemented Interfaces:
ManagedObjectSource<Indexed,,None> JpaManagedObjectSource.PersistenceFactory
public class DataNucleusJpaManagedObjectSource
extends JpaManagedObjectSource
implements JpaManagedObjectSource.PersistenceFactory
DataNucleus
JpaManagedObjectSource.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.officefloor.jpa.JpaManagedObjectSource
JpaManagedObjectSource.DependencyType, JpaManagedObjectSource.EntityManagerWrapper, JpaManagedObjectSource.EntityManagerWrapperFactory, JpaManagedObjectSource.JpaManagedObject, JpaManagedObjectSource.PersistenceFactoryNested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends Enum<O>,F extends Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext -
Field Summary
Fields inherited from class net.officefloor.jpa.JpaManagedObjectSource
PROPERTY_DEPENDENCY_TYPE, PROPERTY_PERSISTENCE_FACTORY, PROPERTY_PERSISTENCE_UNIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.persistence.EntityManagerFactorycreateEntityManagerFactory(String persistenceUnitName, DataSource dataSource, Properties properties) Creates theEntityManagerFactory.getPersistenceFactory(SourceContext context) Obtains theJpaManagedObjectSource.PersistenceFactory.protected booleanIndicates if required to run withinEntityTransaction.Methods inherited from class net.officefloor.jpa.JpaManagedObjectSource
beginTransaction, commitTransaction, getConnection, getManagedObject, loadMetaData, loadSpecificationMethods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObjectMethods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
Constructor Details
-
DataNucleusJpaManagedObjectSource
public DataNucleusJpaManagedObjectSource()
-
-
Method Details
-
getPersistenceFactory
protected JpaManagedObjectSource.PersistenceFactory getPersistenceFactory(SourceContext context) throws Exception Description copied from class:JpaManagedObjectSourceObtains the
JpaManagedObjectSource.PersistenceFactory.Specific vendor implementations may override this method to specify the
JpaManagedObjectSource.PersistenceFactory.By default, this method uses the
JpaManagedObjectSource.PROPERTY_PERSISTENCE_FACTORYPropertyto load theJpaManagedObjectSource.PersistenceFactory.- Overrides:
getPersistenceFactoryin classJpaManagedObjectSource- Parameters:
context-SourceContext.- Returns:
JpaManagedObjectSource.PersistenceFactory.- Throws:
Exception- If fails to create theJpaManagedObjectSource.PersistenceFactory.
-
isRunWithinTransaction
protected boolean isRunWithinTransaction()Description copied from class:JpaManagedObjectSourceIndicates if required to run withinEntityTransaction.- Overrides:
isRunWithinTransactionin classJpaManagedObjectSource- Returns:
trueif required to run withinEntityTransaction.
-
createEntityManagerFactory
public jakarta.persistence.EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, DataSource dataSource, Properties properties) throws Exception Description copied from interface:JpaManagedObjectSource.PersistenceFactoryCreates theEntityManagerFactory.- Specified by:
createEntityManagerFactoryin interfaceJpaManagedObjectSource.PersistenceFactory- Parameters:
persistenceUnitName- Persistence Unit name.dataSource-DataSourceto use for theEntityManagerFactory.nullifEntityManagerFactoryto create and manage theDataSource.properties- Existing properties configured to theJpaManagedObjectSource.- Returns:
- Configuration for the
EntityManagerFactoryto use theDataSource. - Throws:
Exception- If fails to create theEntityManagerFactory.
-