Improved code samples for PageableArgumentResolver. Corrected registration info for DomainClassConverter and added JavaConfig example. Replace all obsolete readAll(…) method samples with findAll(…). Added hint to @PageableDefaults now being aware of sort properties and direction.
Fully qualified first mentions of Pageable and Sort to avoid ambiguities with types of potentially available types of the same name in a store specific implementation.
Updated the repositories reference documentation section on query parsing to reflect the correct usage of method prefixes, how to use the Distinct, IgnoreCase and OrderBy clauses.
The section on the repository exporters contained a code sample using language="javascript". As the highlighting in the docbkx plugin doesn't support javascript as language it will break the build of other reference documents including this one. Removed the language attribute for this sample entirely.
Completely rewrote namespace bean definition parsing to be extendable more easily. Separated XML concerns from annotation based configuration. The central point to extend the namespace parsing for a certain module is now hidden behind the RepositoryConfigurationExtension interface (have a look at the RepositoryConfigurationExtensionSupport base class as well).
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.
Made clear that the usages of the JPA namespace are a convenience artifact to keep the sample code copyable as much as possible but need to be tweaked in case one uses repositories with a different store. Added language attributes to code snippets where missing.
Refactored BasicMappingContext into AbstractMappingContext that now only contains the general algorithm to build PersistentEntity and PersistentProperty instances. The algorithm delegates to two template methods that are responsible for instantiating concrete implementations of those classes.
Extracted an AnnotationBasedPersistentProperty that now contains all annotation references so that AbstractPersistentEntity does not take annotations into account in the first places. BasicPersistentEntity now does PreferredConstructor lookup as well.
Removed unnecessary methods from MappingCOntext and PersistentEntity interface. Added a verify() method to BasicPersistentEntity that AbstractMappingContext calls to verify validity of the entity. This will be used by the Mongo module for example to make sure @Document annotated entities have an @Id property.
Refactored getValueAnnotation() to getSpelExpression() to not imply we're using annotations in every case.
Added shortcut in TypeDiscoverer.createInfo(…) to prevent endless loop in case a type has a field of it's very same type.
TypeDiscoverer now returns the plain compound type for arrays now, which means you get String for String[], String[][] and so on. Opened up signature of AbstractMappingContext.setInitialEntitySet(…) to allow effortless programatic invocation.