diff --git a/persistence-modules/spring-data-jpa-2/src/main/java/com/baeldung/config/JpaPopulators.java b/persistence-modules/spring-data-jpa-2/src/main/java/com/baeldung/config/JpaPopulators.java index 0791df85f4..24348d31c5 100644 --- a/persistence-modules/spring-data-jpa-2/src/main/java/com/baeldung/config/JpaPopulators.java +++ b/persistence-modules/spring-data-jpa-2/src/main/java/com/baeldung/config/JpaPopulators.java @@ -22,11 +22,13 @@ public class JpaPopulators { @Bean public UnmarshallerRepositoryPopulatorFactoryBean repositoryPopulator() { - Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); - marshaller.setClassesToBeBound(Fruit.class); + + Jaxb2Marshaller unmarshaller = new Jaxb2Marshaller(); + unmarshaller.setClassesToBeBound(Fruit.class); + UnmarshallerRepositoryPopulatorFactoryBean factory = new UnmarshallerRepositoryPopulatorFactoryBean(); - factory.setUnmarshaller(marshaller); - factory.setResources(new Resource[] { new ClassPathResource("fruit-data.xml") }); + factory.setUnmarshaller(unmarshaller); + factory.setResources(new Resource[] { new ClassPathResource("apple-fruit-data.xml"), new ClassPathResource("guava-fruit-data.xml") }); return factory; } diff --git a/persistence-modules/spring-data-jpa-2/src/main/resources/fruit-data.xml b/persistence-modules/spring-data-jpa-2/src/main/resources/apple-fruit-data.xml similarity index 100% rename from persistence-modules/spring-data-jpa-2/src/main/resources/fruit-data.xml rename to persistence-modules/spring-data-jpa-2/src/main/resources/apple-fruit-data.xml diff --git a/persistence-modules/spring-data-jpa-2/src/main/resources/guava-fruit-data.xml b/persistence-modules/spring-data-jpa-2/src/main/resources/guava-fruit-data.xml new file mode 100644 index 0000000000..ffd75bb4bb --- /dev/null +++ b/persistence-modules/spring-data-jpa-2/src/main/resources/guava-fruit-data.xml @@ -0,0 +1,7 @@ + + + + 2 + guava + green +