DATAJPA-631 - ResourceLoader improvements in ClasspathScanningPersistenceUnitPostProcessor.

A custom ResourceLoader configured on ClasspathScanningPersistenceUnitPostProcessor is now propagated to the ClassPathScanningCandidateComponentProvider used for looking up entity classes. We also forward the configured environment so that profile annotations are evaluated as well.

Related issue: DATACMNS-591.
This commit is contained in:
Oliver Gierke
2014-11-26 12:40:13 +01:00
parent 50d2490c0f
commit aeab939ae2
2 changed files with 36 additions and 13 deletions

View File

@@ -152,7 +152,7 @@ public class ClasspathScanningPersistenceUnitPostProcessorUnitTests {
ClasspathScanningPersistenceUnitPostProcessor processor = new ClasspathScanningPersistenceUnitPostProcessor(
basePackage);
ReflectionTestUtils.setField(processor, "resolver", resolver);
ReflectionTestUtils.setField(processor, "mappingFileResolver", resolver);
processor.setMappingFileNamePattern("**/*orm.xml");
processor.postProcessPersistenceUnitInfo(pui);
@@ -162,7 +162,5 @@ public class ClasspathScanningPersistenceUnitPostProcessorUnitTests {
}
@Entity
public static class SampleEntity {
}
public static class SampleEntity {}
}