Commit Graph

960 Commits

Author SHA1 Message Date
Oliver Gierke
b294bfce3b DATACMNS-714 - Added support for CompletableFuture and ListenableFuture for query methods.
Spring Framework 4.2 is going to introduce support for CompletableFuture as return type for @Async methods. Support for Spring's ListenableFuture has already been supported in the framework 4.1. We've added the necessary infrastructure to  allow these types as return types on repository methods, too.

Related tickets: SPR-13128.
2015-06-16 14:35:21 +02:00
Oliver Gierke
a8b64c3828 DATACMNS-710 - Polishing.
Some additional JavaDoc, deprecations, copyright headers.

Original pull request: #128.
2015-06-15 22:16:46 +02:00
Phillip Webb
8156c2a151 DATACMNS-710 - Replace ObjectInstantiatorClassGenerator
Deprecate ObjectInstantiatorClassGenerator and provide a replacement
ClassGeneratingEntityInstantiator which doesn't retain a reference to
the context class loader.

Original pull request: #128.
2015-06-15 22:16:43 +02:00
Oliver Gierke
b60f5d84ec DATACMNS-648 - Parameters now holds a non-static ParameterNameDiscoverer.
Turned the previously static ParameterNameDiscoverer into an instance variable to make sure the instance can be GCed correctly.
2015-06-15 18:01:42 +02:00
Oliver Gierke
de4f1ffb7b DATACMNS-713 - PageImpl now adapts total if necessary.
On a last page the total handed into a PageImpl constructor might not necessarily fit the content as there's the change of an insertion or deletion between the calculated count and the retrieval of the content. We now leniently mitigate those differences if the page created is the last page of the result.

Related tickets: DATAJPA-728, DATACMNS-615.
2015-06-15 14:24:03 +02:00
Oliver Gierke
7107a599bb DATACMNS-710 - ObjectInstantiatorClassGenerator now uses default class loader.
We're now using ClassUtils.getDefaultClassloader() to make sure we adhere to any class loading tricks the framework might impose for domain type instantiation.
2015-06-09 22:01:25 +02:00
阮杰锋
a57bac07e2 DATACMNS-707 - Fixed typo in JavaDoc of CrudRepository
Changed from ( to { in JavaDoc of file CrudRepository.

Original pull request: #127.
2015-06-09 11:33:41 +02:00
Oliver Gierke
0cee206776 DATACMNS-569 - Fixed reference documentation on using underscores in property path expressions. 2015-06-04 12:03:05 +02:00
Oliver Gierke
c76c8275d1 DATACMNS-706 - After release cleanups. 2015-06-02 11:40:21 +02:00
Spring Buildmaster
3d1c690c00 DATACMNS-706 - Prepare next development iteration. 2015-06-01 23:41:41 -07:00
Spring Buildmaster
ba6f29a895 DATACMNS-706 - Release version 1.11.0 M1 (Gosling). 2015-06-01 23:41:39 -07:00
Oliver Gierke
7e048ea43a DATACMNS-706 - Prepare 1.11.0.M1 (Gosling M1). 2015-06-02 08:25:09 +02:00
Oliver Gierke
8a78043d92 DATACMNS-706 - Updated changelog. 2015-06-02 08:24:42 +02:00
Oliver Gierke
501f0c8493 DATACMNS-700 - ReflectionRepositoryInvoker now captures context for failed parameter conversions.
Introduced QueryMethodParameterConversionException to capture the context of a failed ConversionException to allow better error reporting.

Cleaned up test cases to not use deprecated API anymore.
2015-05-22 10:29:19 +02:00
Oliver Gierke
1fb7466065 DATACMNS-701 - First and last links are now always rendered for navigable PagedResources.
We now always render both first and last links in case the page returned is navigable, which essentially means: whenever the result spans across more than one page. I.e. whenever either a next or prev link will be rendered, both first and last links are rendered, too.

Clients can still reason about the fact whether they're on the first or last page by the non-presence of prev (indicates you're on the first page) or next (indicates you're on the last page).
2015-05-20 13:33:53 +02:00
Oliver Gierke
62170ab767 DATACMNS-701 - PagedResourcesAssembler now adds first and last links.
We now add first and last links to the PagedResources created in line with the appearance of the prev and next links. The PagedResourcesAssembler can be configured to enforce the rendering using setForceFirstAndLastRels(…).
2015-05-20 13:30:41 +02:00
Oliver Gierke
c5aaebd0e4 DATACMNS-699 - PagedResourcesAssembler now allows to create empty Page with type information. 2015-05-18 16:19:14 +02:00
Oliver Gierke
65104a4a3a DATACMNS-697 - TypeDiscoverer now considers field-local generics information.
In case we create a ParameterizedTypeInformation for a property we now also analyze the field-local generics information and add the discovered type mappings to the type variable map.
2015-05-16 18:55:47 +02:00
Greg Turnquist
89f3be473c DATACMNS-696 - Enable Slack notifications for Travis build.
Original pull request: #123.
2015-05-15 12:25:25 +02:00
Oliver Gierke
6ebb05e606 DATACMNS-515 - Links for PagedResources should be canonical.
PagedResourcesAssembler now creates the self, prev and next links for a PagedResource to be canonical and not contain any template parameters. This is to make sure a client can not actually tweak the links and follow a link that's not strictly conforming to semantics of the rel.
2015-05-14 14:06:35 +02:00
Oliver Gierke
5b60d487e1 DATACMNS-695 - Fixed potential NullPointerException in AbstractMappingContext.getPersistentPropertyPath(…).
When traversing nested property paths, AbstractMappingContext.getPersistentPropertyPath(…) previously used the raw actual property type. If the property path contains a reference to a generically typed property, this causes the deeper paths not being resolved correctly.

We now explicitly use the TypeInformation of the property to retain generics information while traversing the path.
2015-05-13 18:33:58 +02:00
Oliver Gierke
9230b5f30f DATACMNS-692 - Fixed web parameter range handling for Pageables.
In case the PageableHandlerMethodArgumentResolver was configured to use one-indexed parameters, it wasn't defaulting the lower bounds for the page number. This caused indexes out of the allowed bound submitted causing an invalid index handed tor PageRequest. We now apply better range shifting before the bounds are applied.
2015-05-13 18:00:19 +02:00
Oliver Gierke
5405c6e2e7 DATACMNS-694 - Removed <relativePath /> element from parent POM declaration. 2015-05-13 14:40:19 +02:00
Tomasz Wysocki
024dd50d92 DATACMNS-693 - AbstractMappingContext now uses Spring's BeanUtils to lookup PropertyDescriptors.
Instead of manually using Introspector.getBeanInfo(…) we now use Spring's BeanUtils.getPropertyDescriptors(…) to benefit from some caching of descriptor instances as well as advanced support for fluent setters, default methods etc.

Original pull request: #122.
2015-05-13 13:22:57 +02:00
Oliver Gierke
c82d185177 DATACMNS-689 - Improved reference documentation on web pagination.
Re-added index and defaulting information to the section that documents the currents state of web pagination. Removed legacy pagination sections as they're not really documenting the very legacy support (that would not even work anymore).

Added explicit anchors where missing.
2015-05-07 10:44:17 +02:00
Oliver Gierke
2d62c149bb DATACMNS-542 - Simplified way to customize repository base class.
RepositoryFactorySupport now exposes a setRepositoryBaseClass(…) to take a custom type that instances will be created reflectively for. This removes the need for a boilerplate repository factory and FactoryBean implementation to hook custom repository base class implementations into the infrastructure.

RepositoryFactorySupport now exposes a getTargetRepositoryViaReflection(…) method to allow sub-classes to create repository instances and consider customized repository base classes nonetheless. getTargetRepository(…) needs a tiny signature change which unfortunately requires imple

Fixed schema registration for version 1.8 schema. Added new XSD containing a base-class attribute on the <repositories /> element to customize the repository base class via XML.

Removed outdated section of how to create a custom base repository class from the reference documentation and replaced it with new simplified instructions.

Deprecated usage of factory-class attribute in configuration. Point users to newly introduced way of configuring a base class directly to avoid the need for a boilerplate repository factory and factory bean implementation.

DefaultRepositoryInformation now makes target class methods assignable before caching and returning them, so that they can always be invoked reflectively. Made this aspect part of the contract of RepositoryInformation.getTargetClassMethod(…).
2015-05-04 14:31:59 +02:00
Oliver Gierke
af2e1c50c3 DATACMNS-687 - Added section on dependency management to reference docs.
Added a dedicated dependencies.adoc that outlines the usage of the Spring Data release train BOM as well as the way one would customize the release train to be used with Spring Boot.

Also, we now explicitly list the Spring Framework version the release requires.
2015-05-04 14:31:59 +02:00
Thomas Darimont
9e43c2adca DATACMNS-682 - Add details of how to customize repository scanning using JavaConfig.
Completed description for the packages-to-scan customization with JavaConfig.

Original pull request: #121.
2015-04-16 12:07:49 +02:00
Oliver Gierke
cb78260322 DATAREST-684 - ProxyProjectionFactory now exposes target instance on proxy.
Changed TargetClassAware to TargetAware and expose the actual proxy target for framework purposes.
2015-04-15 20:42:34 +02:00
Oliver Gierke
9977c61667 DATACMNS-683 - Tweaked the matching algorithm for DomainClassConverter.
DomainClassConverter as well as its internal ToEntity- and ToIdConverter implementations now actively refrain from matching if the source type is assignable to the target one to prevent unnecessary conversion attempts if the source value already actually is assignable to the target type.

Related ticket: DATACMNS-583.
2015-04-13 17:40:40 +02:00
Oliver Gierke
d48fddf9e6 DATACMNS-681 - Removed some compiler warnings.
Removed unused constants. Removed usage of deprecated method in RepositoryBeanDefinitionParser.
2015-04-13 13:04:59 +02:00
Oliver Gierke
74b452433e DATACMNS-680 - Switch to Guava version property defined in parent POM. 2015-04-13 13:02:07 +02:00
Oliver Gierke
b0044b0dc3 DATACMNS-679 - Updated Sonargraph architecture description. 2015-04-13 13:00:51 +02:00
Oliver Gierke
e3df8907fb DATACMNS-678 - Improved RepositoryInvoker.invokeQueryMethod(…).
Introduced a new overload for invokeQueryMethod(…) that uses a MultiValueMap with effective values of type Object so that clients can hand non-String values to the invocation. This is particularly useful if certain values shall trigger dedicated Converters registered in the ConversionService of ReflectionRepositoryInvoker.

Related tickets: DATAREST-502.
2015-04-07 16:43:01 +02:00
Oliver Gierke
b0211911b5 DATACMNS-677 - AnnotationBasedPersistentProperty now caches absence of annotations on accessor-only properties.
AnnotationBasedPersistentProperty now also caches the absence of properties that are expressed through accessors only. Previously the absence of a field caused us to skip the registration of the absence in the cache.
2015-04-07 08:44:30 +02:00
Arlo Louis O'Keeffe
1d2ad3f2b4 DATACMNS-674 - Fixed typo in reference documentation. 2015-04-01 15:25:37 +02:00
Oliver Gierke
ffbaeddedb DATACMNS-613 - Removed custom CollectionFactory after upgrade to Spring 4.1. 2015-03-31 17:13:37 +02:00
Oliver Gierke
1c175ef59b DATACMNS-673 - Enhanced RepositoryMetadata to allow returning alternative domain types.
In case a RepositoryMetadata implementation alters the domain type the repository is actually handling, we still have to be able to find the repository based on the type originally declared in the repository.

The newly introduced getAlternativeDomainTypes() is now used by Repositories to register a repository for all types returned by that method, too, so that this reverse lookup still works.
2015-03-31 16:30:39 +02:00
Oliver Gierke
5d6fd02ce1 DATACMNS-664 - Removed obsolete build profiles for Travis CI build.
Removed build profiles for Spring 4.0.x snapshots and Spring 4.1 after we upgraded to Spring 4.1 as general baseline.
2015-03-27 13:38:38 +01:00
Oliver Gierke
53d19c72c3 DATACMNS-663 - Fixed typo in BytecodeGeneratingEntityInstantiator. 2015-03-27 12:33:13 +01:00
Oliver Gierke
346016f67d DATACMNS-662 - After release cleanups. 2015-03-23 13:56:32 +01:00
Spring Buildmaster
3185f2c04c DATACMNS-662 - Prepare next development iteration. 2015-03-23 04:20:00 -07:00
Spring Buildmaster
49981eb385 DATACMNS-662 - Release version 1.10.0.RELEASE. 2015-03-23 04:19:56 -07:00
Oliver Gierke
2cba292686 DATACMNS-662 - Prepare 1.10.0.RELEASE (Fowler GA). 2015-03-23 12:08:20 +01:00
Oliver Gierke
be4245061b DATACMNS-662 - Updated changelog. 2015-03-23 12:03:52 +01:00
Thomas Darimont
6f7d8489bf DATACMNS-654 - Polishing.
Added missing documentation for geospatial return types.
Fixed typo in GeoResult JavaDoc.
2015-03-23 11:13:36 +01:00
Oliver Gierke
51b155c0a8 DATACMNS-654 - Polishing.
Removed obsolete line-breaks in repositories documentation. Replace TWR worth with less ambiguous try-with-resources. Slight rewording. A few more details and fixed use of monospace font in return type reference.

Original pull request: #119.
2015-03-21 18:27:17 +01:00
Thomas Darimont
3a02d6f14e DATACMNS-654 - Documented usage of Java 8 Streams in repositories.
Added section to repository documentation on how to use streams. Added an overview table for the generally supported return types for query methods.

Original pull request: #119.
2015-03-21 18:09:18 +01:00
Oliver Gierke
5487395397 DATACMNS-661 - Polishing.
Removed the ability to configure a custom SpElExpressionParser for now as it's not really part of the performance optimization. Polished assertions in SpelEvaluatingMethodInterceptor.

Original pull request: #118.
2015-03-19 18:57:20 +01:00
Thomas Darimont
0cf395c1b1 DATACMNS-661 - Improvements in SpelAwareProxyProjectionFactory.
We now allow a SpelExpressionParser to be configured on the SpelAwareProxyProjectionFactory. This parser is then passed on to SpelEvaluatingMethodInterceptor. We also now eagerly pre-parse any SpEL expression in @Value annotations on methods of the projection interface. This avoids repeated evaluations during the actual method invocations.

Original pull request: #118.
2015-03-19 18:57:19 +01:00