Class ClasspathScanningPersistenceUnitPostProcessor
java.lang.Object
org.springframework.data.jpa.support.ClasspathScanningPersistenceUnitPostProcessor
- All Implemented Interfaces:
Aware
,EnvironmentAware
,ResourceLoaderAware
,PersistenceUnitPostProcessor
public class ClasspathScanningPersistenceUnitPostProcessor
extends Object
implements PersistenceUnitPostProcessor, ResourceLoaderAware, EnvironmentAware
PersistenceUnitPostProcessor
that will scan for classes annotated with Entity
or
MappedSuperclass
and add them to the PersistenceUnit
post processed. Beyond that
JPA XML mapping files can be scanned as well by configuring a file name pattern.- Author:
- Oliver Gierke, Thomas Darimont, Mark Paluch, David Madden
-
Constructor Summary
ConstructorDescriptionClasspathScanningPersistenceUnitPostProcessor
(String basePackage) Creates a newClasspathScanningPersistenceUnitPostProcessor
using the given base package as scan base. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
setEnvironment
(Environment environment) void
setMappingFileNamePattern
(String mappingFilePattern) Configures the file name pattern JPA entity mapping files shall scanned from the classpath.void
setResourceLoader
(ResourceLoader resourceLoader)
-
Constructor Details
-
ClasspathScanningPersistenceUnitPostProcessor
Creates a newClasspathScanningPersistenceUnitPostProcessor
using the given base package as scan base.- Parameters:
basePackage
- must not be null or empty.
-
-
Method Details
-
setMappingFileNamePattern
Configures the file name pattern JPA entity mapping files shall scanned from the classpath. Lookup will use the configured base package as root.- Parameters:
mappingFilePattern
- must not be null or empty.
-
setResourceLoader
- Specified by:
setResourceLoader
in interfaceResourceLoaderAware
-
setEnvironment
- Specified by:
setEnvironment
in interfaceEnvironmentAware
-
postProcessPersistenceUnitInfo
- Specified by:
postProcessPersistenceUnitInfo
in interfacePersistenceUnitPostProcessor
-