Package net.officefloor.jpa.hibernate
Class HibernateJpaManagedObjectSource
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.hibernate.HibernateJpaManagedObjectSource
- All Implemented Interfaces:
ManagedObjectSource<Indexed,,None> JpaManagedObjectSource.PersistenceFactory
public class HibernateJpaManagedObjectSource
extends JpaManagedObjectSource
implements JpaManagedObjectSource.PersistenceFactory
Hibernate
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.Methods inherited from class net.officefloor.jpa.JpaManagedObjectSource
beginTransaction, commitTransaction, getConnection, getManagedObject, isRunWithinTransaction, 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
-
HibernateJpaManagedObjectSource
public HibernateJpaManagedObjectSource()
-
-
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.
-
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.
-