Class JpaConfiguration.EntityScanConfiguration
java.lang.Object
io.micronaut.configuration.hibernate.jpa.JpaConfiguration.EntityScanConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
- Enclosing class:
- JpaConfiguration
@ConfigurationProperties("entity-scan")
public static class JpaConfiguration.EntityScanConfiguration
extends Object
implements io.micronaut.core.util.Toggleable
The entity scan configuration.
-
Constructor Summary
ConstructorDescriptionEntityScanConfiguration
(io.micronaut.context.env.Environment environment) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionCollection<Class<?>>
Find entities for the current configuration.String[]
The packages to limit the scan to.boolean
void
setEnabled
(boolean enabled) Set whether entity scan is enabled.void
setPackages
(String[] packages)
-
Constructor Details
-
EntityScanConfiguration
public EntityScanConfiguration(io.micronaut.context.env.Environment environment) Default constructor.- Parameters:
environment
- The environment
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) Set whether entity scan is enabled. Defaults to true.- Parameters:
enabled
- True if it is enabled
-
getPackages
The packages to limit the scan to.- Returns:
- The packages to limit the scan to
-
setPackages
- Parameters:
packages
- The packages
-
findEntities
Find entities for the current configuration.- Returns:
- The entities
-