Commit Graph

513 Commits

Author SHA1 Message Date
Oliver Gierke
e11efede4d DATACMNS-236, DATACMNS-117 - Added (Pageable|Sort)HanderMethodArgumentResolvers.
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.
2013-02-19 13:09:40 +01:00
Oliver Gierke
ed32d83ab3 DATACMNS-287 - Added missing package-info.java files. 2013-02-19 12:47:01 +01:00
Oliver Gierke
9fae10750e DATACMNS-286 - Extended Page/Pageable APIs.
Pageable and Page interfaces now expose API to easily access Pageables pointing to the previous and next Page instance if available.
2013-02-19 12:45:11 +01:00
Oliver Gierke
7df1cb7deb DATACMNS-285 - Polished template.mf.
Use Bundlor property replacement in favor of hard coded versions to automatically pick up more dependency upgrades automatically.
2013-02-19 12:44:18 +01:00
Oliver Gierke
0aef8c60b7 DATACMNS-283 - MappingInstantiationException captures more context now.
If an exception occurs in ReflectionEntityInstantiator we now capture more context about the failed instantiation.
2013-02-15 18:34:56 +01:00
Oliver Gierke
e093aead13 DATACMNS-117 - Added PageableHandlerArgumentResolver.
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.
2013-02-12 17:35:15 +01:00
Oliver Gierke
0bbf0aec99 DATACMNS-282 - Improved caching in AnnotationBasedPersistentProperty.
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.
2013-02-11 15:56:14 +01:00
Spring Buildmaster
0bbe56740b DATACMNS-279 - Prepare next development iteration. 2013-02-07 05:10:53 -08:00
Spring Buildmaster
a8c582d99a DATACMNS-279 - Release version 1.5.0.RELEASE. 2013-02-07 05:10:49 -08:00
Oliver Gierke
9de9217069 DATACMNS-279 - Upgraded to Spring Data parent pom in 1.0.0.RELEASE. 2013-02-07 14:05:02 +01:00
Oliver Gierke
1564704f0c DATACMNS-279 - Prepare release of version 1.5.0. 2013-02-07 13:53:47 +01:00
Oliver Gierke
680ac315b7 Added Eclipse code formatter. 2013-02-07 13:26:04 +01:00
Oliver Gierke
80b6dd2217 DATACMNS-278 - Added Converter implementations for JodaTime types.
Upgraded to JodaTime 2.1 based on super pom property definition.
2013-02-06 17:49:24 +01:00
Oliver Gierke
e79035cb42 DATACMNS-277 - Added general documentation on auditing. 2013-01-30 13:51:57 +01:00
Oliver Gierke
626c0ba38f DATACMNS-266 - Removed the obsolete ${schema.key}. 2013-01-29 19:43:14 +01:00
Oliver Gierke
45694c6ea9 DATACMNS-266 - Added necessary properties to enable distribution upload. 2013-01-29 19:15:07 +01:00
Oliver Gierke
3e40413ffe DATACMNS-275 - Introduced getObfuscatedPassword in UserCredentials. 2013-01-29 13:10:36 +01:00
Oliver Gierke
6b49eb4ca5 DATACMNS-276 - Added hashCode() to ParameterizedTypeInformation.
Implemented hashCode() to be as close as possible to the equals(…) implementation.
2013-01-29 13:07:44 +01:00
Oliver Gierke
f18055a4c9 DATACMNS-274 - Fixed package cycle in mapping subsystem.
Updated Sonargraph architecture description along the way.
2013-01-29 10:50:50 +01:00
Oliver Gierke
06497a6814 DATACMNS-273 - Upgraded to Spring HATEOAS 0.4.0.RELEASE. 2013-01-28 16:27:01 +01:00
Oliver Gierke
33a31a25e0 DATACMNS-271 - AnnotationBasedPersistentProperty now caches annotation lookups. 2013-01-28 14:28:12 +01:00
Beverley Talbott
8e3b0cb1e6 DATACMNS-258 - Copyediting of reference documentation. 2013-01-28 12:53:44 +01:00
Oliver Gierke
d972e984fe DATACMNS-266 - Refer to deployment repository to get unfiltered pom. 2013-01-18 14:43:47 +01:00
Biju Kunjummen
979c0f70fb DATAJPA-266 - Polish documentation on pagination.
Fixed information in documentation, 0 indexed Pageable and page.page instead of page for page parameter. Fixes pull request #21.
2013-01-18 09:44:54 +01:00
Oliver Gierke
3a72d56ee8 DATACMNS-266 - Fixed JavaDoc of Page and PageImpl.
Includes pull request #16.
2013-01-18 09:42:12 +01:00
Oliver Gierke
e9e8d4015d DATACMNS-265 - Fixed JavaDoc.
Essentially fixes pull request #22.
2013-01-18 09:33:21 +01:00
Oliver Gierke
2eba53619e DATACMNS-266 - Re-added repository declarations to pom.xml.
For some reasons the <repository /> and <pluginRepository /> elements get stripped from the Spring Data parent pom during the deployment onto Artifactory so they do not end up in the pom.xml published although defined in the source pom.xml.
2013-01-16 17:31:38 +01:00
Oliver Gierke
afb5ec2ef9 DATACMNS-269 - Add support for mapping annotations on accessor methods.
Mapping annotations are now looked up in the following order: getter, setter, field. Made mapping annotations usable on methods as well.
2013-01-16 17:29:51 +01:00
Oliver Gierke
ac256f9921 DATACMNS-266 - Use new common Maven build infrastructure.
Simplified project setup to be a single module build again. Using Spring Data Build parent POM to simplify project setup. See https://github.com/SpringSource/spring-data-build#spring-data-build-infrastructure
2013-01-16 15:15:24 +01:00
Oliver Gierke
c908d0e023 DATACMNS-265 - Polished JavaDoc. 2013-01-11 11:35:02 +01:00
Oliver Gierke
68ef3c68b0 DATACMNS-263 - Fixed incompatibility with OpenWebbeans < 1.1.8.
Prefer using non-anonymous inner classes to represent @Default and @Any qualifiers. Upgraded to OpenWebbeans 1.1.7 along the way.
2013-01-05 19:31:42 +01:00
Oliver Gierke
c289428fe5 DATACMNS-260 - Extracted SpelExpressionParameterValueProvider.
Extracted SpelExpressionParameterValueProvider from PersistentEntityParameterValueProvider to allow extension to recursively map the value resolved from the SpEL expression evaluation. This extension has to override the potentiallyConvertSpelValue(…) method to continue nested conversion.
2012-12-16 15:09:00 +01:00
Oliver Gierke
0c4ed8a86a DATACMNS-257 - PropertyPath can now handle all-uppercase fields.
So far, PropertyPath inevitably uncapitalized the property names it was created for. We now check, whether the source name is all uppercase and prevent uncapitalization in this case.
2012-11-29 12:22:30 +01:00
Oliver Gierke
d0111d8118 DATACMNS-256 - Exposing getPersistentEntity() on Repositories.
Extended RepositoryFactoryInformation to expose the PersistentEntity for the domain type the repository factory is eventually creating the repository for. The default implementation in RepositoryFactoryBeanSupport exposes a protected setMappingContext(…) that is later used to lookup the PersistentEntity.
2012-11-28 17:18:55 +01:00
Oliver Gierke
d5e0517517 DATACMNS-255 - Made TypeFilterParser public.
Moved it into common config package. Changed visibility to public. Polished JavaDoc now that it's available to public consumption.
2012-11-28 15:41:42 +01:00
Oliver Gierke
7712fe1563 DATACMNS-254 - Polished JavaDoc of Auditable. 2012-11-27 15:10:31 +01:00
Oliver Gierke
a05a6d5e77 DATACMNS-253 - Improved exception message in ParameterOutOfBoundsException. 2012-11-27 13:39:36 +01:00
Oliver Gierke
70639d0d4b DATACMNS-137 - Added configuration support for AuditingHandlers.
Added attribute group to namespace XSD to define common attributes used to set up an AuditingHandler. Added BeanDefinitionParser that will create a BeanDefinition for an AuditingHandler based on these properties. Store-specific namespace implementations can use that to simplify the configuration setup. Added an IsNewAwareAuditingHandlerBeanDefinitionParser to do the same for an IsNewAwareAuditingHandler.
2012-11-26 18:15:42 +01:00
Oliver Gierke
cc1561d92c DATACMNS-251 - Introduced generic abstraction to determine "is new" state of entities.
Introduced IsNewStrategy and IsNewStrategyFactory interfaces to allow abstracting the way the is-new state of an entity can be determined. The factory allows creating a strategy instance by inspected type, whereas the actual strategy then implements the is-new decision based on a given entity.

We provide a MappingContext based factory implementation that looks up a PersistentEntity for the type requested and inspects it for an @Version or @Id property. It will then return strategy implementations that inspect the detected properties and check their values against null or 0 respectively. We also add a CachingIsNewStrategyFactory wrapper to prevent the lookup of the actual strategy from being done over and over again.

The @Version annotation was pulled up from the Spring Data MongoDB module. It can be used as meta annotation to allow a deprecation step on the MongoDB's @Version one.

Added an IsNewAwareAuditingHandler that exposes a unifying markAudited(…) delegating to the markCreated(…) and markModified(…) depending on the outcome of the IsNewStrategy.
2012-11-26 18:14:38 +01:00
Oliver Gierke
8a01a55046 DATACMNS-227 - Renamed repository resource populator location attribute to locations.
Tightened test cases to check correct population more strictly. Upgraded to Hamcrest 1.3 as test dependency on the way.
2012-11-23 15:06:42 +01:00
Oliver Gierke
f1fd8fe0e2 DATACMNS-137, DATAJPA-116 - Added support for annotation based auditing.
Introduced annotations CreatedBy, CreatedDate, LastModifiedBy and LastModifiedDate to allow demarcating fields as auditing related ones. The date related annotations require a field type of either DateTime, Date, Long or a primitive long. All these annotations can be used as meta-annotations.

Extracted an AuditingHandler from Spring Data JPA which allows to transparently set auditing information on objects implementing Auditable or use the newly introduced annotations in a store independent manner. This allows other stores to implement adapters to provide auditing support as well.

Introduced a more convenient way of finding fields in ReflectionUtils using the FieldFilters of core Spring. The API allows to select fields based on a filter and can transparently check that only one field matches the given filter if desired.
2012-11-20 17:25:16 +01:00
Oliver Gierke
2042bda8a2 DATACMNS-248 - Moved to Slf4j API for logging. 2012-11-19 23:30:14 +01:00
Oliver Gierke
c0e45a4a3b DATACMNS-247 - Improved implementation of RepositoryBeanDefinitionRegistrarSupport.
RepositoryBeanDefinitionRegistrarSupport not implements BeanClassLoaderAware and ResourceLoaderAware as Spring 3.2 will regard these callback interfaces and inject the resources. We still default these injected resources upon invocation to be able to run on Spring 3.1 as well.
2012-11-13 15:06:54 +01:00
Oliver Gierke
874da365ed DATACMNS-168 - Allow customizing repository bean names.
The bean name is now resolved through inspecting Spring stereotype annotations and @Named on the repository interface. If none found we're still using the uncapitalized simple interface name as we did until now.
2012-11-12 14:28:13 +01:00
Spring Buildmaster
075e31d917 DATACMNS-192 - Prepare next development iteration. 2012-10-09 05:31:15 -07:00
Spring Buildmaster
18c1392e96 DATACMNS-192 - Release version 1.4.0.RELEASE. 2012-10-09 05:31:11 -07:00
Oliver Gierke
14815dca3a DATACMNS-192 - Updated changelog for 1.4.0.RELEASE. 2012-10-09 14:24:11 +02:00
Oliver Gierke
3498af528a DATACMNS-242 - Improved exception messages in QueryMethod. 2012-10-09 14:05:34 +02:00
Oliver Gierke
e675e14082 DATACMNS-241 - Upgraded to Spring HATEOAS 0.3.0.RELEASE. 2012-10-09 14:05:17 +02:00
Oliver Gierke
75026cdb1d DATACMNS-239 - Fixed event handling in AbstractResourcePopulatorFactoryBean.
Switched from implementing ApplicationEventPublisherAware to ApplicationContextAware to get a reference to an ApplicationContext to fix comparison of the event source.
2012-10-09 10:59:08 +02:00