BAEL-2841 updated code to use multiple xml files
This commit is contained in:
parent
93d6d243ac
commit
029ab027ed
|
@ -22,11 +22,13 @@ public class JpaPopulators {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public UnmarshallerRepositoryPopulatorFactoryBean repositoryPopulator() {
|
public UnmarshallerRepositoryPopulatorFactoryBean repositoryPopulator() {
|
||||||
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
|
|
||||||
marshaller.setClassesToBeBound(Fruit.class);
|
Jaxb2Marshaller unmarshaller = new Jaxb2Marshaller();
|
||||||
|
unmarshaller.setClassesToBeBound(Fruit.class);
|
||||||
|
|
||||||
UnmarshallerRepositoryPopulatorFactoryBean factory = new UnmarshallerRepositoryPopulatorFactoryBean();
|
UnmarshallerRepositoryPopulatorFactoryBean factory = new UnmarshallerRepositoryPopulatorFactoryBean();
|
||||||
factory.setUnmarshaller(marshaller);
|
factory.setUnmarshaller(unmarshaller);
|
||||||
factory.setResources(new Resource[] { new ClassPathResource("fruit-data.xml") });
|
factory.setResources(new Resource[] { new ClassPathResource("apple-fruit-data.xml"), new ClassPathResource("guava-fruit-data.xml") });
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<fruit>
|
||||||
|
<id>2</id>
|
||||||
|
<name>guava</name>
|
||||||
|
<color>green</color>
|
||||||
|
</fruit>
|
Loading…
Reference in New Issue