We now don't try to eagerly lookup the beans Repositories shall capture in the constructor anymore but leniently look them up on the first request. Update tests for classes using Repositories alongside.
Extracted the activation of persistence exception translation into a separate RepositoryProxyPostProcessor. Adapted TransactionalRepositoryFactoryBeanSupport to also register the newly introduced PersistenceExceptionTranslationRepositoryProxyPostProcessor.
So far the property lookup of a nested property path (e.g. "foo.bar") failed in cases the head property was not cached already. We now recursively resolve the type information even for an unpopulated cache.
Previously, the RepositoryBeanDefinitionBuilder did not forward the repository configuration's source instance into the built BeanDefinitions. This is now fixed to enable STS track the origin of the BeanDefinition back to the configuration source (an @Enable-annotation or an XML namespace element).
PartTree now supports query methods starting with "count…By" and exposes that fact through an isCountProjection() method to be used by query creators upstream
ReflectionEntityInstantiator now actually throws the wrapped exception created in the catch block handling BeanInstantiationExceptions.
Pull request: #25.
Added HandlerMethodArgumentResolver implementations for Pageable and Sort exposing a new default set of properties (page, size, sort) to resolve pagination and sorting information from the request. To mimic the legacy behavior we expose a (deprecated) LEGACY constant in PageableHandlerMethodArgumentResolver. Clients should move to the new properties structure ASAP. Added unit tests to verify old and new defaulting behavior.
Introduced new annotations @SortDefault (with @SortDefaults wrapper annotation) and @PageableDefault (superseding the legacy @PageableDefaults). The new annotations have more speaking attribute names and the HMAR implementations transparently alias the generic value attribute into a more semantic one (size).
The HMAR implementations implement Spring HATEOAS' UriComponentsContributor to be able to turn Pageable / Sort instances back into URIs created through the MethodLinkBuilderFactory API in Spring HATEOAS.
Extracted common API between legacy PageableArgumentResolver and PageableHandlerMethodArgumentResolver into common helper class.
Upgraded to Spring Hateoas 0.5.0.BUILD-SNAPSHOT.
Added PageableHandlerArgumentResolver to supersede the now deprecated PageableArgumentResolver. The latter still stays available for Spring 3.0.x based deployments. Updated reference documentation to mention the newly introduced type as well as possible configuration options.
AnnotationBasedPersistentProperty now caches direct annotations on construction but still tries to lookup an annotation as meta-annotation if not found in cache on later requests. Extended try/catch block in AbstractMappingContext.addPersistentEntity(…) to invalidate cache on exceptions during property creation as well.
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.