Commit Graph

661 Commits

Author SHA1 Message Date
Oliver Gierke
fa80df2fa0 DATACMNS-425 - Upgrade to Spring Data Build snapshots. 2014-02-03 14:31:11 +01:00
Spring Buildmaster
1a94ffa796 DATACMNS-425 - Prepare next development iteration. 2014-01-29 04:24:57 -08:00
Spring Buildmaster
e00763bc44 DATACMNS-425 - Release version 1.7.0.RC1. 2014-01-29 04:24:55 -08:00
Oliver Gierke
8fa19aa01e DATACMNS-425 - Prepare 1.7.0.RC1 release.
Upgraded to Spring Data Build parent 1.3.0.RC1 and Spring HATEOAS 0.9.0.RELEASE. Switched to milestone repositories. Updated changelog and adapted notice.txt.
2014-01-28 13:24:18 +01:00
Oliver Gierke
8f0979e963 DATACMNS-431 - Code cleanups. 2014-01-28 13:14:35 +01:00
Oliver Gierke
30a63f5546 DATACMNS-418 - Added test case to show how to use custom element assembler. 2014-01-27 08:42:50 +01:00
Oliver Gierke
a16375bb17 DATACMNS-418 - PagedResourcesAssembler now exposes method to append template parameters.
PagedResourcesAssembler.appendPaginationParameterTemplates adds the currently missing pagination template variables to the given link.
2014-01-23 15:50:10 +01:00
Oliver Gierke
f1d49c6f37 DATACMNS-429 - Improved JavaDoc for PageRequest and Sort.
Added a few missing parameter documentations in terms of semantics and nullability.
2014-01-23 12:23:13 +01:00
Oliver Gierke
26c4f2dd87 DATACMNS-430 - Using Jackson version property from build parent.
Removed custom dependency from Spring 4 profile as it's already included in the parent pom.
2014-01-22 17:52:53 +01:00
Oliver Gierke
6822f39e3b DATACMNS-422 - Remove workaround in test cases after recent fix for generic component types.
Build should be fine on Spring 4 now.
2014-01-22 17:46:37 +01:00
Oliver Gierke
0ce214cd56 DATACMNS-418 - Use TemplateVariables value type for pagination templates.
Changed Hateoas(Pageable|Sort)HandlerMethodArgumentResolver to use newly introduced TypeVariables abstraction to avoid having to deal with string representations manually.

The registered TemplateVariables carry a "pagination.….description" key to be resolved against a MessageSource.
2014-01-21 14:31:46 +01:00
Oliver Gierke
0f38612dab DATACMNS-426 - RepositoryMetadata now has an isPagingRepository().
Moved getCrudMethods() to RepositoryMetadata to be able to add a isPagingRepository() to the interface as well. Changed DefaultCrudMethods to work with a RepositoryMetadata instead of RepositoryInformation.

DefaultRepositoryInformation now completely delegates to the ResourceMetadata given and not extend it to avoid initialization order issues.
2014-01-21 14:31:37 +01:00
Oliver Gierke
059d398480 DATACMNS-425 - Use new repository URLs and add repo for build plugins.
Removed test dependency as it's already declared in Spring Data Build parent POM.
2014-01-20 12:38:03 +01:00
Oliver Gierke
3fb4469bea DATACMNS-418 - Adapt to latest changes in Spring HATEOAS. 2014-01-19 19:31:30 +01:00
Oliver Gierke
f8e9f7f8ce DATACMNS-423 - Deprecated Jackson 1 repository initializers. 2014-01-19 15:43:49 +01:00
Oliver Gierke
1f172725f0 DATACMNS-422 - Mitigate semantic changes in Spring 4.0's GenericTypeResolver.
In case of an unresolvable generic parameter in TypeDiscoverer's getTypeArgument(…) we check for a generic super type for the given bound and fall back to Object in case we find a parameterized type.
2014-01-19 15:37:44 +01:00
Oliver Gierke
3fc927ceb8 DATACMNS-421 - Removed obsolete version declarations for Spring dependencies. 2014-01-19 15:37:44 +01:00
Oliver Gierke
a5eedad48f DATACMNS-420 - Introduced RepositoryConfigurationDelegate.
RepositoryConfigurationDelegate allows to easily trigger repository BeanDefinitions to be registered independently of the client API (XML or annotation configuration support). Refactored the existing configuration base classes to use the newly introduced class. Removed defaulting of infrastructure components needed for Spring 3.1 compatibility.
2014-01-18 12:35:21 +01:00
Oliver Gierke
e646fc9f16 DATACMNS-418 - Improvements to template variables in HandlerMethodArgumentResolvers.
The Hateoas(Pageable|Sort)HandlerMethodArgumentResolver now receive a UriComponents instance to inspect for existing query parameters. They then refrain from adding template variables for already present parameters. Slightly modified the way the sort parameters is appended to the pagination properties (although semantically equivalent).
2014-01-17 12:45:10 +01:00
Oliver Gierke
72a8d072a3 DATACMNS-419 - PagedResourceAssemblerArgumentResolver now works with templated URIs.
We now handle an IllegalArgumentException being thrown in case we deal with a templated request mapping. We simply skip the attempt to eagerly resolve the base URI for the request and rely on the assembler being capable of resolving it itself or the user effectively providing a Link instances to one of the toResource(…) overloads.
2014-01-16 14:34:14 +01:00
Oliver Gierke
92a22182f1 DATACMNS-418 - PagedResourcesAssembler now adds self links to PagedResources.
PagedResourcesAssembler now adds a LinkTemplate to every PagedResources instance created and pulls the template variable information from the registered resolvers for Pageable and Sort.

Extended PageableResourceAssemblerArgumentResolver to create a special MethodParameterAwarePagedResourcesAssembler so that the assembler will take qualifier information into account when being injected into controller methods.

Upgraded to Spring HATEOAS 0.9.0.BUILD-SNAPSHOT to be able to benefit from new methods added to MethodParameters as well as the LinkTemplate class. Updated Sonargraph architecture definition to allow the web layer to access logging.
2014-01-16 14:31:55 +01:00
Oliver Gierke
9db6ccaa4b DATACMNS-412 - Fixed potential classloader leak.
Turned the static cache of RepositoryInformations in RepositoryFactorySupport into a non-static one to avoid the instance from potentially surviving redeployments in web app scenarios.
2014-01-14 17:44:23 +01:00
Oliver Gierke
a89d1ce8ff DATACMNS-417 - Added contribution guidelines.
Linked to the actual contribution guidelines maintained in the Spring Data Build project.
2014-01-14 13:39:53 +01:00
Oliver Gierke
5906ae04da DATACMNS-415 - Further performance improvements for repository config.
We now also set a resource pattern on the ClassPathScanningCandidateComponentProvider to limit the scanning for custom implementations even more and thus avoid reading a lot of unnecessary class files.
2014-01-13 18:31:31 +01:00
Oliver Gierke
df1373aa81 DATACMNS-416 - Added means to enforce eager instantiation of CDI repositories.
The CDI extension now eagerly instantiates repository beans that are annotated with the newly introduced @Eager annotation. This is necessary to prevent the initialization procedure from interfering with potentially already executed business logic.

To achieve this CdiRepositoryExtensionSupport provides a new method registerBean(…) that has to be called by store implementations. The extension will then keep track of beans that require eager initialization and trigger it when the container has finished validation.
2014-01-13 11:53:32 +01:00
Oliver Gierke
bf3437f39c DATACMNS-415 - Performance improvements in configuration subsystem.
Changed the design of RepositoryBeanDefinitionBuilder to receive stable dependencies in the constructor and the moving parts as method arguments. This enables us to reuse the builder instance for the creation of all repository bean definitions. Most importantly that means we can use a single CachingMetadataReaderFactory instance which will avoid reading files again when looking for custom implementation classes.

Adapted clients for XML configuration and JavaConfig accordingly.
2014-01-12 23:13:32 +01:00
Oliver Gierke
51b128fac1 DATACMNS-411 - Add support for Java 8 date/time types in auditing.
The auditing subsystem now supports the usage of JDK 8 date time types when running on Spring 4.0.1 or better. To achieve that switched to use the DefaultFormattingConversionService which registers the relevant converters needed. We also modified the SPI CurrentDateTimeProvider to return a Calendar instance as it carries time-zone information to be able to convert the instance into time-zone based JDK 8 date/time types.

This also allows us to make the use of JodaTime optional and only rely on it in case of the usage of Auditable or any of the JodaTime types used in the annotation based scenario. Added support to set LocalDateTime as well.
2014-01-12 19:23:35 +01:00
Oliver Gierke
05f303c2be DATACMNS-414 - Removed unnecessary generic types for AuditingHandler.
Removed the unnecessary type arguments for AuditingHandler so that the setter taking an AuditorAware<T> can be successfully wired against implementations other than AuditorAware<Object> with Spring 4. The type argument was superfluous anyway as internally the type wasn't referred to and the handler is not used on a by-type basis.
2014-01-12 19:23:22 +01:00
Oliver Gierke
e21a7850f6 DATACMNS-407 - Fixed sort parameter building in HateoasAwareSortHandlerMethodArgumentResolver.
We're now replacing the sort parameter for the URI to be created instead of simply appending them to the source URI to prevent previously applied sort parameters to be taken forward.
2013-12-16 12:59:50 +01:00
Thomas Darimont
f148d19c81 DATACMNS-410 - Fixed bug in ReflectionRepositoryInvoker#invokeFindOne.
We now delegate calls to invokeFindOne to the correct target repository.

Original pull request: #80.
2013-12-13 13:39:58 +01:00
Oliver Gierke
11f1207e4e DATACMNS-403 - Upgraded to snapshot versions of Spring Data build parent. 2013-12-12 15:40:23 +01:00
Oliver Gierke
78443eb83e DATACMNS-379 - Fixed AIOOBE in SortHandlerMethodArgumentResolver. 2013-12-05 14:45:28 +01:00
Oliver Gierke
cc4a4de892 DATACMNS-408 - Handle invalid pagination and sorting parameters gracefully.
The PageableHandlerMethodArgumentResolver and SortHandlerMethodArgumentResolver now transparently ignore invalid values provided for page number, size and sort. We fall back to ignore the invalid values (for sort) and fall back to the defaults where appropriate (page number and size).

Used and adapted test cases from pull request #48.
2013-12-05 10:37:42 +01:00
Oliver Gierke
62e14d2b12 DATACMNS-402 - Slight refinements in QSort implementation.
Re-enable concatenation with plain Sort via ….and(…) method. Some general polishing and JavaDoc cleanups.

Original pull request: #59.
2013-12-04 13:30:19 +01:00
Thomas Darimont
f2ff84fb63 DATACMNS-402 - Add support for sorting by a QueryDSL OrderSpecifier.
Previously we did only support ordering by a string or property path through Sort. In order to be able to express more type safe ordering expressions we introduce QSort as a subclass of Sort that is able to wrap QueryDSL OrderSpecifiers. To be able to separate the concerns of sorting via QueryDSL expressions better we introduce the AbstractPageRequest base class and QPageRequest as a special implementation that accepts a QSort or OrderSpecifiers for ordering.

Original pull request: #59.
2013-12-04 13:09:25 +01:00
Oliver Gierke
9f65b57867 DATACMNS-406 - Polishing.
Refactored code in RepositoryMetadata implementations to avoid compiler warnings. Some JavaDoc polishing.

Original pull request: #58.
2013-11-21 12:39:32 +01:00
Thomas Darimont
b96f613b98 DATACMNS-406 - Tighten contract for RepositoryMetadata implementations.
We now resolve the domain and id-types eagerly within the constructor of AbstractRepositoryMetadata implementations to prevent a RepositoryMetadata instance to be created in an invalid state. Pulled-up repositoryInterface property to AbstractRepositoryMetadata.

Original pull request: #58.
2013-11-21 12:39:17 +01:00
Spring Buildmaster
09b8989a7f DATACMNS-403 - Prepare next development iteration. 2013-11-19 03:53:05 -08:00
Spring Buildmaster
0abed479e7 DATACMNS-403 - Release version 1.7.0.M1. 2013-11-19 03:53:03 -08:00
Thomas Darimont
341912acec DATACMNS-403 - Prepare release 1.7 M1.
Updated release metadata and bumped versions.
2013-11-19 12:48:42 +01:00
Thomas Darimont
eddb3323de DATACMNS-399 - Support query prefix to designate repository query methods.
Extended PREFIX regex in PartTree to support the "query" prefix.

Original author: @jiming
Original pull request: #56.
2013-11-19 12:26:11 +01:00
Thomas Darimont
ba89dc9bb4 DATACMNS-404 - Move formatter configuration to Spring Data Build project.
Original pull request: #57.
2013-11-19 11:39:14 +01:00
Oliver Gierke
c0fc0f905a DATACMNS-401 - Some cleanups regarding generics and deprecations.
Suppress deprecation warnings for GenericTypeResolver for now. Added Simple(Property|Association)Handler to ease working with untyped PersistentProperty instances without having to fall back to raw types. Polished Sonargraph architecture description.
2013-11-14 09:28:11 +00:00
Oliver Gierke
fed61720b0 DATACMNS-400 - PersistentProperty now exposes findAnnotation(…).
Pulled up the method declaration from AnnotationBasedProperty as it's useful to be able to inspect a property for annotations being configured on it independently from whether the persistent mapping of it has been defined via annotations or not.

Expose isAnnotationPresent(…) as well to ease quick checks for an annotation.
2013-11-13 18:09:28 +00:00
Oliver Gierke
22223f4386 DATACMNS-393 - Improved CRUD method detection in DefaultCrudMethods.
Slightly refined the detection algorithm to favor early returns and thus avoid unnecessary reflection lookups.

Original pull request: #55.
2013-11-12 15:07:55 +01:00
Thomas Darimont
907ea74d8a DATACMNS-393 - Improved CRUD method detection in DefaultCrudMethods.
The detection of CRUD methods in DefaultCrudMethods is now carried out in a more robust and predictable fashion. The exact algorithm is described in the JavaDoc.

Original pull request: #55.
2013-11-12 15:07:55 +01:00
Oliver Gierke
5a6cefc4a9 DATACMNS-389 - RepositoryFactorySupport now caches RepositoryInformation.
Instead of creating a new DefaultRepositoryInformation for each call to getRepositoryInformation(…) we now actively cache the created instances per repository type and custom implementation class.
2013-11-12 15:03:24 +01:00
Oliver Gierke
d7b0a3e4d4 DATACMNS-392, DATACMNS-386 - Polished code after upgrade to Spring 3.2.5.
Spring 3.2.5 made AnnotationConfigUtils.processCommonDefinitionAnnotations(…) public so that we can call it directly instead of invoking it via reflection.
2013-11-12 13:15:52 +01:00
Oliver Gierke
a438d1ef17 DATACMNS-389 - Polishing of @Enable…Auditing support.
JavaDoc and assertion fixes.

Original pull requests: #26, #53.
2013-11-11 20:04:52 +01:00
Thomas Darimont
a7d909846c DATACMNS-389 - Support for JavaConfig in auditing.
Basic infrastructure for supporting annotation based auditing configuration.

Introduces AuditingBeanDefinitionRegistrarSupport for store specific auditing configuration enhancements. An AuditorAware instance is wired into the Auditing handler automatically if it's present in the ApplicationContext. The auditorAwareRef attribute of the enabling annotation can be used to disambiguate in case multiple AuditorAware instances are present in the configuration.

Original pull requests: #26, #53.
2013-11-11 20:04:40 +01:00