Class AotEntityManagerFactoryCreator
java.lang.Object
org.springframework.data.jpa.repository.aot.AotEntityManagerFactoryCreator
Wrapper for
EntityManagerFactory. The wrapper object implements equality checks based on its creation
arguments and can be conveniently used as cache key.
Factory methods provide ways to create instances based on provided EntityManagerFactory or contextual holders
to extract managed types and create an in-memory EntityManagerFactory variant for metamodel introspection
during AOT processing.
- Since:
- 4.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionbooleanfrom(jakarta.persistence.spi.PersistenceUnitInfo persistenceUnitInfo) Create aPersistenceUnitContextfrom the givenPersistenceUnitInfo.from(AotRepositoryContext repositoryContext) Create aPersistenceUnitContextfrom the givenAotRepositoryContextusing Jakarta Persistence-annotated classes.from(PersistenceManagedTypes managedTypes) Create aPersistenceUnitContextfrom the givenPersistenceManagedTypes.jakarta.persistence.EntityManagerFactoryReturn theEntityManagerFactory.inthashCode()just(jakarta.persistence.EntityManagerFactory entityManagerFactory) Create aPersistenceUnitContextfrom the givenEntityManagerFactory.toString()
-
Method Details
-
from
Create aPersistenceUnitContextfrom the givenAotRepositoryContextusing Jakarta Persistence-annotated classes.The underlying
Metamodelrequires Hibernate to build metamodel information.- Parameters:
repositoryContext- repository context providing classes.
-
from
public static AotEntityManagerFactoryCreator from(jakarta.persistence.spi.PersistenceUnitInfo persistenceUnitInfo) Create aPersistenceUnitContextfrom the givenPersistenceUnitInfo.The underlying
Metamodelrequires Hibernate to build metamodel information.- Parameters:
persistenceUnitInfo- persistence unit info to use.
-
from
Create aPersistenceUnitContextfrom the givenPersistenceManagedTypes.The underlying
Metamodelrequires Hibernate to build metamodel information.- Parameters:
managedTypes- managed types to use.
-
just
public static AotEntityManagerFactoryCreator just(jakarta.persistence.EntityManagerFactory entityManagerFactory) Create aPersistenceUnitContextfrom the givenEntityManagerFactory.- Parameters:
entityManagerFactory- the entity manager factory to use.
-
getEntityManagerFactory
public jakarta.persistence.EntityManagerFactory getEntityManagerFactory()Return theEntityManagerFactory.- Returns:
- the entity manager factory to use during AOT processing.
-
equals
-
hashCode
-
toString
-