Package persist.hibernate.enhance.spi
Interface HibernateEnhancerProvider
- All Superinterfaces:
PersistenceServiceProvider
- All Known Implementing Classes:
JakartaHibernateEnhancerProvider,LegacyHibernateEnhancerProvider
Service-provider interface for obtaining a namespace-specific
HibernateEnhancer.
Implementations are discovered at runtime via
ServiceLoader. The convenience method
getHibernateEnhancerProvider(String) maps a JPA specification
version to the correct provider.
- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetEnhancer(File classesDir, Set<File> classpathFiles, Map<HibernateEnhancer.Option, Boolean> options) Creates aHibernateEnhancerconfigured with the given classpath and enhancement options.static HibernateEnhancerProvidergetHibernateEnhancerProvider(String jpaVersion) Discovers and returns theHibernateEnhancerProviderfor the given JPA specification version.Methods inherited from interface persist.api.spi.PersistenceServiceProvider
getSupportedNamespace
-
Method Details
-
getEnhancer
HibernateEnhancer getEnhancer(File classesDir, Set<File> classpathFiles, Map<HibernateEnhancer.Option, Boolean> options) Creates aHibernateEnhancerconfigured with the given classpath and enhancement options.- Parameters:
classesDir- the directory containing compiled entity class filesclasspathFiles- additional classpath entries required for enhancement (e.g. JPA API and Hibernate JARs)options- a map ofHibernateEnhancer.Optionflags controlling which transformations are applied- Returns:
- a new enhancer instance
-
getHibernateEnhancerProvider
Discovers and returns theHibernateEnhancerProviderfor the given JPA specification version.- Parameters:
jpaVersion- the JPA specification version (e.g."3.1")- Returns:
- the matching provider
- Throws:
IllegalArgumentException- ifjpaVersionis not recognisedIllegalStateException- if no provider is registered for the resolved namespace- See Also:
-