Refactored persistent field discovery by extracting the FieldFilter implementation and improving the way excluded fields are detected. We now exclude all fields named "this$*" as well as a metaClass field of type groovy.lang.MetaClass explicitly.
There have been a few dependencies which we depended on on compile time but which were pulled into the classpath transitively. Declaring these dependencies now explicitly. Keeping them optional to allow minimal footprint.
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.
Added custom CDI extension to use repositories in a CDI environment. Base class picks up all Spring Data repository interfaces and allows working with qualifiers to bind beans to be created to qualifiers.
Upgraded to Hamcrest 1.2.1. Removed obsolete Log4J transitive dependency exclusions as 1.2.16 does not include these dependencies anymore. Using Mockito and JUnit dependencies not containing Hamcrest types.