Class JpaConfiguration
- java.lang.Object
-
- io.micronaut.configuration.hibernate.jpa.JpaConfiguration
-
@EachProperty(value="jpa", primary="default") public class JpaConfiguration extends 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(String name, io.micronaut.context.ApplicationContext applicationContext, Integrator integrator)
protected
JpaConfiguration(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(Map<String,Object> additionalSettings)
Deprecated.Deprecated and scheduled to be removed.JpaConfiguration
copy(String name)
Copies current configuration.protected BootstrapServiceRegistryBuilder
createBootstrapServiceRegistryBuilder(Integrator integrator, ClassLoader classLoader)
Deprecated.Deprecated and scheduled to be removed.protected StandardServiceRegistryBuilder
createStandServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
Deprecated.Deprecated and scheduled to be removed.JpaConfiguration.EntityScanConfiguration
getEntityScanConfiguration()
List<String>
getMappingResources()
Mapping resources (equivalent to "mapping-file" entries in persistence.xml).String
getName()
String[]
getPackagesToScan()
Map<String,Object>
getProperties()
boolean
isCompileTimeHibernateProxies()
Compile time Hibernate proxies.boolean
isReactive()
void
setCompileTimeHibernateProxies(boolean compileTimeHibernateProxies)
Enable compile time Hibernate proxies.void
setMappingResources(List<String> mappingResources)
Sets additional mapping resources.void
setPackagesToScan(String... packagesToScan)
Sets the packages to scan.void
setProperties(Map<String,Object> jpaProperties)
Sets the JPA properties to be passed to the JPA implementation.void
setReactive(boolean reactive)
-
-
-
Field Detail
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
PRIMARY
public static final 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 String name, io.micronaut.context.ApplicationContext applicationContext, @Nullable Integrator integrator)
- Parameters:
name
- The nameapplicationContext
- The application contextintegrator
- TheIntegrator
-
JpaConfiguration
@Inject protected JpaConfiguration(@Parameter 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 String getName()
- Returns:
- The configuration name
-
getEntityScanConfiguration
public JpaConfiguration.EntityScanConfiguration getEntityScanConfiguration()
- Returns:
- The entity scan configuration
-
buildStandardServiceRegistry
@Deprecated public StandardServiceRegistry buildStandardServiceRegistry(@Nullable Map<String,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(String... packagesToScan)
Sets the packages to scan.- Parameters:
packagesToScan
- The packages to scan
-
getPackagesToScan
public String[] getPackagesToScan()
- Returns:
- The packages to scan
-
setProperties
public final void setProperties(@MapFormat(transformation=FLAT,keyFormat=RAW) @NonNull Map<String,Object> jpaProperties)
Sets the JPA properties to be passed to the JPA implementation.- Parameters:
jpaProperties
- The JPA properties
-
createBootstrapServiceRegistryBuilder
@Deprecated protected BootstrapServiceRegistryBuilder createBootstrapServiceRegistryBuilder(@Nullable Integrator integrator, 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 List<String> getMappingResources()
Mapping resources (equivalent to "mapping-file" entries in persistence.xml).- Returns:
- The mapping resources
-
setMappingResources
public void setMappingResources(List<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(String name)
Copies current configuration.- Parameters:
name
- A new name- Returns:
- A copy of current configuration
-
-