Class JpaConfiguration
- java.lang.Object
-
- io.micronaut.configuration.hibernate.jpa.JpaConfiguration
-
@EachProperty(value="jpa", primary="default") public class JpaConfiguration extends java.lang.Object
Configuration for JPA and Hibernate.- Since:
- 1.0
- Author:
- graemerocher
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JpaConfiguration.EntityScanConfiguration
The entity scan configuration.
-
Constructor Summary
Constructors Modifier Constructor Description JpaConfiguration(io.micronaut.context.ApplicationContext applicationContext, Integrator integrator)
JpaConfiguration(java.lang.String name, io.micronaut.context.ApplicationContext applicationContext, Integrator integrator)
protected
JpaConfiguration(java.lang.String name, Integrator integrator, io.micronaut.context.ApplicationContext applicationContext, JpaConfiguration.EntityScanConfiguration entityScanConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StandardServiceRegistry
buildStandardServiceRegistry(java.util.Map<java.lang.String,java.lang.Object> additionalSettings)
Deprecated.Deprecated and scheduled to be removed.JpaConfiguration
copy(java.lang.String name)
Copies current configuration.protected BootstrapServiceRegistryBuilder
createBootstrapServiceRegistryBuilder(Integrator integrator, java.lang.ClassLoader classLoader)
Deprecated.Deprecated and scheduled to be removed.protected StandardServiceRegistryBuilder
createStandServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
Deprecated.Deprecated and scheduled to be removed.JpaConfiguration.EntityScanConfiguration
getEntityScanConfiguration()
java.util.List<java.lang.String>
getMappingResources()
Mapping resources (equivalent to "mapping-file" entries in persistence.xml).java.lang.String
getName()
java.lang.String[]
getPackagesToScan()
java.util.Map<java.lang.String,java.lang.Object>
getProperties()
boolean
isCompileTimeHibernateProxies()
Compile time Hibernate proxies.boolean
isReactive()
void
setCompileTimeHibernateProxies(boolean compileTimeHibernateProxies)
Enable compile time Hibernate proxies.void
setMappingResources(java.util.List<java.lang.String> mappingResources)
Sets additional mapping resources.void
setPackagesToScan(java.lang.String... packagesToScan)
Sets the packages to scan.void
setProperties(java.util.Map<java.lang.String,java.lang.Object> jpaProperties)
Sets the JPA properties to be passed to the JPA implementation.void
setReactive(boolean reactive)
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
PRIMARY
public static final java.lang.String PRIMARY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JpaConfiguration
public JpaConfiguration(io.micronaut.context.ApplicationContext applicationContext, @Nullable Integrator integrator)
- Parameters:
applicationContext
- The application contextintegrator
- TheIntegrator
-
JpaConfiguration
public JpaConfiguration(@Parameter java.lang.String name, io.micronaut.context.ApplicationContext applicationContext, @Nullable Integrator integrator)
- Parameters:
name
- The nameapplicationContext
- The application contextintegrator
- TheIntegrator
-
JpaConfiguration
@Inject protected JpaConfiguration(@Parameter java.lang.String name, @Nullable Integrator integrator, io.micronaut.context.ApplicationContext applicationContext, @Nullable JpaConfiguration.EntityScanConfiguration entityScanConfiguration)
- Parameters:
name
- The nameintegrator
- The integratorapplicationContext
- The application contextentityScanConfiguration
- The entity scan configuration
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- The configuration name
-
getEntityScanConfiguration
public JpaConfiguration.EntityScanConfiguration getEntityScanConfiguration()
- Returns:
- The entity scan configuration
-
buildStandardServiceRegistry
@Deprecated public StandardServiceRegistry buildStandardServiceRegistry(@Nullable java.util.Map<java.lang.String,java.lang.Object> additionalSettings)
Deprecated.Deprecated and scheduled to be removed.Builds the standard service registry.- Parameters:
additionalSettings
- Additional settings for the service registry- Returns:
- The standard service registry
-
setPackagesToScan
public void setPackagesToScan(java.lang.String... packagesToScan)
Sets the packages to scan.- Parameters:
packagesToScan
- The packages to scan
-
getPackagesToScan
public java.lang.String[] getPackagesToScan()
- Returns:
- The packages to scan
-
setProperties
public final void setProperties(@MapFormat(transformation=FLAT,keyFormat=RAW) @NonNull java.util.Map<java.lang.String,java.lang.Object> jpaProperties)
Sets the JPA properties to be passed to the JPA implementation.- Parameters:
jpaProperties
- The JPA properties
-
getProperties
@NonNull public java.util.Map<java.lang.String,java.lang.Object> getProperties()
- Returns:
- The JPA properties
-
createBootstrapServiceRegistryBuilder
@Deprecated protected BootstrapServiceRegistryBuilder createBootstrapServiceRegistryBuilder(@Nullable Integrator integrator, java.lang.ClassLoader classLoader)
Deprecated.Deprecated and scheduled to be removed.Creates the defaultBootstrapServiceRegistryBuilder
.- Parameters:
integrator
- The integrator to use. Can be nullclassLoader
- The class loade rto use- Returns:
- The BootstrapServiceRegistryBuilder
-
createStandServiceRegistryBuilder
@Deprecated protected StandardServiceRegistryBuilder createStandServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
Deprecated.Deprecated and scheduled to be removed.Creates the standard service registry builder.- Parameters:
bootstrapServiceRegistry
- TheBootstrapServiceRegistry
instance- Returns:
- The
StandardServiceRegistryBuilder
instance
-
getMappingResources
@NonNull public java.util.List<java.lang.String> getMappingResources()
Mapping resources (equivalent to "mapping-file" entries in persistence.xml).- Returns:
- The mapping resources
-
setMappingResources
public void setMappingResources(java.util.List<java.lang.String> mappingResources)
Sets additional mapping resources.- Parameters:
mappingResources
- list of mapping files
-
isCompileTimeHibernateProxies
public boolean isCompileTimeHibernateProxies()
Compile time Hibernate proxies.- Returns:
- true if compile time proxies enabled
-
setCompileTimeHibernateProxies
public void setCompileTimeHibernateProxies(boolean compileTimeHibernateProxies)
Enable compile time Hibernate proxies.- Parameters:
compileTimeHibernateProxies
- true to enable compile time proxies
-
isReactive
public boolean isReactive()
- Returns:
- is reactive
-
setReactive
public void setReactive(boolean reactive)
- Parameters:
reactive
- the reactive value
-
copy
public JpaConfiguration copy(java.lang.String name)
Copies current configuration.- Parameters:
name
- A new name- Returns:
- A copy of current configuration
-
-