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
ConstructorsConstructorDescriptionClasspathScanningPersistenceUnitPostProcessor(String basePackage) Creates a newClasspathScanningPersistenceUnitPostProcessorusing the given base package as scan base. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidsetEnvironment(Environment environment) voidsetMappingFileNamePattern(String mappingFilePattern) Configures the file name pattern JPA entity mapping files shall scanned from the classpath.voidsetResourceLoader(ResourceLoader resourceLoader)
-
Constructor Details
-
ClasspathScanningPersistenceUnitPostProcessor
Creates a newClasspathScanningPersistenceUnitPostProcessorusing 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:
setResourceLoaderin interfaceResourceLoaderAware
-
setEnvironment
- Specified by:
setEnvironmentin interfaceEnvironmentAware
-
postProcessPersistenceUnitInfo
- Specified by:
postProcessPersistenceUnitInfoin interfacePersistenceUnitPostProcessor
-