Added RepositoryPopulator abstraction and implementations based on Spring OXM Unmarshallers as well as Jackson. This allows arbitrary repositories being populated with data pulled from XML / JSON, no matter what store they are actually backed. The populator will eventually populate the repositories held in a Repositories instance. It can be used like this:
Repositories repositories = new Repositories(applicationContext);
ResourceReader reader = new JacksonResourceReader();
ResourceReaderRepositoryPopulator populator = new ResourceReaderRepositoryPopulator(reader);
populator.setResourceLocation("classpath*:data.json");
populator.populate(repositories);
The ResourceReader defines what technology shall be used to read the data from the file into objects. The ResourceReaderRepositoryPopulator uses the reader and can either get a set of Resource instances configured or is able to lookup resources using a location string. The actual Repositories instance captures all CrudRepository instances contained inside an ApplicationContext.
The populators can also be used from within XML configuration though the repository namespace elements shown below:
<repository:jackson-populator location="classpath:org/springframework/data/repository/init/data.json" />
<repository:unmarshaller-populator location="classpath:org/springframework/data/repository/init/data.xml" unmarshaller-ref="unmarshaller" />
Updated reference documentation accordingly.
33 lines
2.3 KiB
Plaintext
33 lines
2.3 KiB
Plaintext
Bundle-SymbolicName: org.springframework.data.core
|
|
Bundle-Name: Spring Data Commons Core
|
|
Bundle-Vendor: SpringSource
|
|
Bundle-ManifestVersion: 2
|
|
Import-Package:
|
|
sun.reflect;version="0";resolution:=optional
|
|
Import-Template:
|
|
com.mysema.query.*;version="[2.2.0,3.0.0)";resolution:=optional,
|
|
javax.enterprise.*;version="${cdi.version:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
javax.inject.*;version="[1.0.0,2.0.0)";resolution:=optional,
|
|
javax.xml.transform.*;version="0";resolution:=optional,
|
|
org.codehaus.jackson.*;version="${jackson.version:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.aop.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.beans.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}",
|
|
org.springframework.core.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}",
|
|
org.springframework.context.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.dao.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.expression.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.expression.spel.standard.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.expression.spel.support.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.oxm.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.transaction.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.util.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}",
|
|
org.springframework.validation.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.springframework.web.*;version="${org.springframework.version.30:[=.=.=,+1.0.0)}";resolution:=optional,
|
|
org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional,
|
|
org.apache.commons.logging.*;version="[1.1.1, 2.0.0)",
|
|
org.joda.time.*;version="[1.6.0,2.0.0)";resolution:=optional,
|
|
org.slf4j.*;version="[1.5.0,1.6.0)",
|
|
javax.servlet.*;version="[2.5.0, 3.0.0)";resolution:=optional,
|
|
org.w3c.dom.*;version="0"
|
|
DynamicImport-Package: *
|