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
DataNucleusJpaManagedObjectSource.- 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.PersistenceFactory
-
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.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 Constructor Description DataNucleusJpaManagedObjectSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.persistence.EntityManagerFactorycreateEntityManagerFactory(java.lang.String persistenceUnitName, javax.sql.DataSource dataSource, java.util.Properties properties)Creates theEntityManagerFactory.protected JpaManagedObjectSource.PersistenceFactorygetPersistenceFactory(SourceContext context)Obtains theJpaManagedObjectSource.PersistenceFactory.protected booleanisRunWithinTransaction()Indicates if required to run withinEntityTransaction.-
Methods inherited from class net.officefloor.jpa.JpaManagedObjectSource
beginTransaction, commitTransaction, getConnection, getManagedObject, loadMetaData, loadSpecification
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObject
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
-
-
-
Method Detail
-
getPersistenceFactory
protected JpaManagedObjectSource.PersistenceFactory getPersistenceFactory(SourceContext context) throws java.lang.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:
java.lang.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 javax.persistence.EntityManagerFactory createEntityManagerFactory(java.lang.String persistenceUnitName, javax.sql.DataSource dataSource, java.util.Properties properties) throws java.lang.ExceptionDescription 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:
java.lang.Exception- If fails to create theEntityManagerFactory.
-
-