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.EntityManagerFactory
createEntityManagerFactory(java.lang.String persistenceUnitName, javax.sql.DataSource dataSource, java.util.Properties properties)
Creates theEntityManagerFactory
.protected JpaManagedObjectSource.PersistenceFactory
getPersistenceFactory(SourceContext context)
Obtains theJpaManagedObjectSource.PersistenceFactory
.protected boolean
isRunWithinTransaction()
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:JpaManagedObjectSource
Obtains the
JpaManagedObjectSource.PersistenceFactory
.Specific vendor implementations may override this method to specify the
JpaManagedObjectSource.PersistenceFactory
.By default, this method uses the
JpaManagedObjectSource.PROPERTY_PERSISTENCE_FACTORY
Property
to load theJpaManagedObjectSource.PersistenceFactory
.- Overrides:
getPersistenceFactory
in 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:JpaManagedObjectSource
Indicates if required to run withinEntityTransaction
.- Overrides:
isRunWithinTransaction
in classJpaManagedObjectSource
- Returns:
true
if 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.Exception
Description copied from interface:JpaManagedObjectSource.PersistenceFactory
Creates theEntityManagerFactory
.- Specified by:
createEntityManagerFactory
in interfaceJpaManagedObjectSource.PersistenceFactory
- Parameters:
persistenceUnitName
- Persistence Unit name.dataSource
-DataSource
to use for theEntityManagerFactory
.null
ifEntityManagerFactory
to create and manage theDataSource
.properties
- Existing properties configured to theJpaManagedObjectSource
.- Returns:
- Configuration for the
EntityManagerFactory
to use theDataSource
. - Throws:
java.lang.Exception
- If fails to create theEntityManagerFactory
.
-
-