Commit Graph

845 Commits

Author SHA1 Message Date
Oliver Gierke
f02babd3f8 DATACMNS-620 - Repositories now creates reflective RepositoryInvokers for repositories with redeclared CRUD methods.
If repository interfaces redeclare CRUD methods we need to use a ReflectionRepositoryInvoker rather than the CRUD one to make sure we pick up the customizations applied to the method declaration (e.g. caching or transaction annotations).

This is already fixed in master due to the move to the Spring Data REST RepositoryInvoker API.
2014-12-18 18:57:17 +01:00
Oliver Gierke
a179e4e7df DATACMNS-619 - DefaultCrudMethods now exposes accessible methods.
We now make sure that all methods detected are made accessible so that clients using them can reflectively invoke them without additional checks.
2014-12-18 18:53:10 +01:00
Oliver Gierke
846ab10b01 DATACMNS-616 - Fixed field value lookup for private fields in AnnotationDetectionFieldCallback.
We now make the field detected by the callback accessible so that the value lookup doesn't fail for private fields. Added a few more unit tests to verify behavior.
2014-12-17 17:37:01 +01:00
Oliver Gierke
3324b187dd DATACMNS-615 - PageImpl now rejects a total less than the amount of items given.
PageImpl now makes sure that the total given to the constructor is never less than then number of items given to make sure we do not mask broken count calculation by creating an actually invalid instance.

Related ticket: DATAMONGO-1120.
2014-12-16 12:41:44 +01:00
Oliver Gierke
1151ec88cd DATACMNS-611 - Improved cache lookups in RepositoryInterfaceAwareBeanPostProcessor.
Refactored predictBeanType(…) to only look up the predicted cached type once.

Related pull request: #108.
2014-12-08 17:55:14 +01:00
Oliver Gierke
13698073e2 DATACMNS-610 - Extracted QueryExecutionResultHandler from RepositoryFactorySupport.
To be able to verify the conversion of List based query execution results into Sets I extracted a QueryExecutionResultHandler that applies the already implemented handling for Optional types and eventually general prost processing in case the return type declared at the repository query method doesn't match the returned value.

Added additional unit tests for Optional handling.
2014-12-04 20:35:49 +01:00
Oliver Gierke
0cb1cca588 DATACMNS-609 - Improved bean definition registration for repository configuration.
The bean definitions that were registered for a repository configuration setup we registered once for every usage of the repository configuration element (annotation or XML). This caused multiple registrations of the very same bean definition which - as in case of the RepositoryInterfaceAwareBeanPostProcessor - apparently leads to performance problems in the container startup. Feedback for the latter claim is already asked for but we improved the registration setup nonetheless.

Introduced a registerIfNotAlreadyRegistered(…) method on RepositoryConfigurationExtensionSupport to allow easy registration of to-b-registered-once-and-only-once beans. We now hint towards the newly introduced method in registerWithSourceAndGeneratedBeanName(…).
2014-12-01 10:16:08 +01:00
Oliver Gierke
447aca6e9c DATACMNS-601 - Fixes for most of the SonarQube warnings. 2014-11-26 09:15:10 +01:00
Oliver Gierke
806214e332 DATACMNS-591 - RepositoryConfigurationDelegate now uses Environment and ResourceLoader everywhere.
We now also use the Environment and ResourceLoader for the component scan to detect whether multiple Spring Data modules are on the classpath.
2014-11-24 22:39:03 +01:00
Oliver Gierke
e14ba802a7 DATACMNS-594 - Fixed creation of type variable map to extend into detected bounds.
The initial setup of the type variable map now unfolds the detected types in the map to make sure we detect all type variables present in the current scope.

Added caching of component and map value TypeInformation instances to avoid repeated creation.
2014-11-14 16:35:17 +01:00
Oliver Gierke
e943fdeae4 DATACMNS-590 - Fixed calculation of nested generics in ParentTypeAwareTypeInformation.
So far, the lookup of the type variable map was preferring the type variable maps detected on parent types in nested structures. This caused the concrete type variables in nested types not being considered correctly which caused the type resolution to fall back to the generic bounds.

We now accumulate the type variable maps to avoid having to lookup a certain map in the nesting hierarchy. The core fix is in ParentTypeAwareTypeInformation's constructor and mergeMaps(…) respectively. Simplified the handling of type variable maps and made proper use of generics throughout the class hierarchy.
2014-11-12 14:31:26 +01:00
Oliver Gierke
fa44b9f807 DATACMNS-585 - After release cleanups. 2014-10-31 21:34:45 +01:00
Spring Buildmaster
3471a64f79 DATACMNS-585 - Prepare next development iteration. 2014-10-30 04:18:53 -07:00
Spring Buildmaster
b728ea297e DATACMNS-585 - Release version 1.9.1.RELEASE (Evans SR1). 2014-10-30 04:18:49 -07:00
Oliver Gierke
bae378de68 DATACMNS-585 - Prepare 1.9.1.RELEASE (Evans SR1). 2014-10-30 12:14:04 +01:00
Oliver Gierke
9b210d2c3e DATACMNS-585 - Updated changelog. 2014-10-30 12:13:47 +01:00
Thomas Darimont
386644190a DATACMNS-583 - DomainClassConverter returns input if given types are the same.
DomainClassConverter now returns input when the source type is identical to the target type. Previously we erroneously tried to convert the sourceType to the idType of the targetType's backing repository. As a side effect we also avoid performing some unnecessary converter hops.

Original pull request: #101.
2014-10-29 09:41:22 +01:00
Thomas Darimont
43793f9b3e DATACMNS-580 - Add section on limiting the query results to reference documentation.
Added section explaining the use of first / top keywords to the reference doc.

Original pull request: #99.
2014-10-21 12:31:44 +02:00
Thomas Darimont
36a6c451fa DATACMNS-577 - Improved JavaDoc on QueryDslPredicateExecutor.
Clarified return values if predicates don't match or return multiple results (for the findOne(…) method). Copied summary to the @return tag.

Original pull request: #96.
2014-10-08 06:47:58 +02:00
Thomas Darimont
77fe2b1197 DATACMNS-530 - Improve JavaDoc for RepositoryConfigurationSourceSupport.
Removed misleading JavaDoc.

Original pull request: #97.
2014-10-07 15:01:49 +02:00
Oliver Gierke
4e7ad22263 DATACMNS-572 - After release cleanups. 2014-09-05 13:27:09 +02:00
Spring Buildmaster
4dcda97017 DATACMNS-572 - Prepare next development iteration. 2014-09-05 13:26:43 +02:00
Spring Buildmaster
dedfd9010f DATACMNS-572 - Release version 1.9.0.RELEASE (Evans GA). 2014-09-05 01:57:17 -07:00
Oliver Gierke
17c41522a7 DATACMNS-572 - Prepare 1.9.0.RELEASE (Evans GA).
Upgraded to Spring HATEOAS 0.16.0.RELEASE.
2014-09-05 10:48:48 +02:00
Oliver Gierke
880405c391 DATACMNS-572 - Updated changelog. 2014-09-05 09:23:25 +02:00
Oliver Gierke
ca0a3de685 DATACMNS-568 - Updated changelog. 2014-09-05 07:29:01 +02:00
Oliver Gierke
f3d8256a80 DATACMNS-570, DATACMNS-571 - Removed JDK 7 profile for Travis build. 2014-09-01 13:57:51 +02:00
Oliver Gierke
2c7f7e8e04 DATACMNS-571 - Remove custom build infrastructure for Optional.
We now require a JDK to build Spring Data Commons as using the custom Optional type from the Spring Data Build project as it causes the tests to break as Spring 4.1 snapshots load the Optional type to check for it's ability on the classpath which the JVM rejects.
2014-09-01 13:43:11 +02:00
Mark Paluch
6cc9e33359 DATACMNS-565 - Improved detection of custom implementations for CDI repositories.
The detection of the custom implementation has now been moved into the Bean base class to avoid calls to BeanManager.getBeans(…) (which are necessary to pick up the configuration class defining postfixes and the like) happen to early in the CDI container lifecycle.

Related ticket: DATACMNS-557.
2014-09-01 12:46:12 +02:00
Oliver Gierke
8bfa0bd9e0 DATACMNS-570 - Updated build profiles for Travis.
We now use the profiles existing in Spring Data Build for Spring 4.0.x and 4.1.x.
2014-09-01 12:23:18 +02:00
Thomas Darimont
9fc57ea3bf DATACMNS-566 - Allow sorting by QueryDsl operator expressions.
Previously we only allowed to sort by QueryDsl path expressions. With this change we now also support ordering by operator expressions, e.g. yearMonth() on a date property.

Original pull request: #94.
2014-08-26 13:56:17 +02:00
Oliver Gierke
edfd341d64 DATACMNS-567 - Fixed some glitches in the Asciidoctor files.
Added missing closing backtick in auditing.adoc. Added copyright line to index.adoc and switched to relative level offsets. Use two blank lines at the end of each file consistently. Extracted preface document and added project metadata.
2014-08-22 15:21:05 +02:00
Oliver Gierke
c9dd679cd1 DATACMNS-562 - AbstractPersistentProperty doesn't consider maps and collections entities anymore.
The type detection for entity candidates of PersistentProperty instances now consistently handles collection types even if they're used als collection or map values.
2014-08-19 17:53:51 +02:00
Oliver Gierke
77a67021e5 DATACMNS-561 - After release cleanups. 2014-08-13 16:29:31 +02:00
Spring Buildmaster
4c64eddeb7 DATACMNS-561 - Prepare next development iteration. 2014-08-13 06:19:32 -07:00
Spring Buildmaster
d8e9808dd4 DATACMNS-561 - Release version 1.9.0.RC1 (Evans RC1). 2014-08-13 06:19:28 -07:00
Oliver Gierke
2386f48233 DATACMNS-561 - Prepare 1.9.0.RC1 (Evans RC1). 2014-08-13 15:13:06 +02:00
Oliver Gierke
ceeb768d19 DATACMNS-561 - Updated changelog. 2014-08-13 15:04:57 +02:00
Oliver Gierke
49071659c0 DATACMNS-549 - Updated changelog. 2014-08-13 10:44:11 +02:00
Oliver Gierke
62ddd29bad DATACMNS-551 - Fixed some broken links in the reference documentation. 2014-08-12 12:03:54 +02:00
Oliver Gierke
3c38218940 DATACMNS-552 - Naming conventions for custom repository implementations are now more obvious.
Added a note to hint to the Impl postfix to be important and refer to the paragraphs following for more details on that,
2014-08-10 14:46:09 +02:00
Oliver Gierke
5d0f581068 DATACMNS-548 - Reference documentation now mentions Slice return type in special parameter handling. 2014-08-10 13:31:36 +02:00
Oliver Gierke
5352701374 DATACMNS-556 - Make annotation validation in AnnotationBasedPersistentProperty more lenient.
Annotations used on both fields and accessors are now only rejected if they're Spring Data annotations (i.e. from the org.springframework.data namespace) and the configurations of these annotations differ.
2014-08-10 13:15:39 +02:00
Oliver Gierke
3660676338 DATACMNS-558 - Some code cleanups according to the Sonar report. 2014-08-10 12:51:28 +02:00
Oliver Gierke
756c951112 DATACMNS-557 - Polishing.
Renamed CdiRepositoryConfigurationSource to CdiRepositoryConfiguration. Turned anonymous inner default implementation into dedicated enum to avoid repeated instantiation.

Changed the CdiRepositoryBean to rather take a Bean instance of the custom implementation instead of the resolved object to make sure both instances (the custom implementation and the repository proxy) are instantiated at the same time.

Fixed imports. Some early returns to avoid unnecessary nesting.

Adapted architecture description to allow CDI module accessing the configuration module.

Related pull request: #92.
2014-08-07 12:33:29 +02:00
Mark Paluch
1f0260e48d DATACMNS-557 - Added support for custom implementations to CDI infrastructure.
The CDI extension now discovers a custom implementation class similarly to the detection when using Spring Data in a Spring container. Extracted the custom implementation detection for re-use. The CDI extension discovers the potentially available bean and hands it to the CdiRepositoryBean for further usage.

Implementations should implement the extended variant of the create(…) method we introduce with this commit to be able to forward the resolved custom implementation bean.

Original pull request: #92.
2014-08-07 12:05:09 +02:00
Oliver Gierke
62e66ab305 DATACMNS-551 - Move to Asciidoctor for reference documentation. 2014-08-06 21:20:08 +02:00
Oliver Gierke
85157b6644 DATACMNS-526 - Added type matching to strict repository scanning.
Repository interfaces are now also considered strict matches if they are assignable to one of the types returned by getIdentifyingTypes().
2014-07-31 12:54:08 +02:00
Oliver Gierke
81af5ee730 DATACMNS-526 - Improved configuration behavior in multi-store scenarios.
We now apply a stricter repository interface selection if we detect multiple Spring Data modules to be in the classpath to avoid the repository scanning accidentally overriding each others definitions or even picking up interfaces they weren't intended to manage.

The detection is based on a type scan in dedicated base package where subtypes of RepositoryFactorySupport usually reside. If more than one type is found, we activate strict scanning.

The strict check is actually implemented in RepositoryConfigurationExtensionSupport to be accessible for store implementations. By default we try to load the repository candidate interface and inspect the managed domain types for a collection of annotations (see RepositoryConfigurationExtensionSupport.getIdentifyingAnnotations()). Implementors still have the chance to customize the behavior by overriding isStrictRepositoryCandidate(…).

We also introduced a getModuleName() to be able to create better logging output in terms of repository registration. Moved registration of RepositoryConfigurationExtension as Spring bean into the base types for XML and annotation configuration support to make sure they only kick in if explicit configuration is used.
2014-07-28 19:56:40 +02:00
Oliver Gierke
3bcf6f3f27 DATACMNS-547 - @TypeAlias is now @Persistent.
For @TypeAlias annotated types being picked up using entity scanning, the annotation is now @Persistent.

Related tickets: DATAMONGO-992.
2014-07-24 14:13:10 +02:00