Commit Graph

354 Commits

Author SHA1 Message Date
Oliver Gierke
0abdc68abb DATACMNS-724 - Updated changelog. 2015-07-01 02:22:03 +02:00
Oliver Gierke
43e3c35559 DATACMNS-723 - Prepare 1.8.6.RELEASE (Dijkstra SR6). 2015-07-01 02:09:09 +02:00
Oliver Gierke
e98682a8d2 DATACMNS-723 - Updated changelog. 2015-07-01 02:08:26 +02:00
Oliver Gierke
afea5a583a DATACMNS-725 - Updated changelog. 2015-06-30 13:49:37 +02:00
Oliver Gierke
ed92135d34 DATACMNS-706 - Updated changelog. 2015-06-30 13:49:20 +02:00
Oliver Gierke
c9045bd2b5 DATACMNS-662 - Updated changelog. 2015-06-30 13:49:11 +02:00
Oliver Gierke
b40fc3419d DATACMNS-652 - Updated changelog. 2015-06-30 13:48:58 +02:00
Oliver Gierke
57056c7a65 DATACMNS-633 - Updated changelog. 2015-06-30 13:48:36 +02:00
Oliver Gierke
cc079b18e4 DATACMNS-713 - Disabled total adaption in PageImpl for empty pages.
The newly introduced adaption of the total in PageImpl must only be applied if the page accessed is not empty.
2015-06-30 11:09:15 +02:00
Oliver Gierke
7d56d535fb DATACMNS-719 - Version now parses strings with non-numeric suffixes correctly.
Extended Version value object to correctly dump a non-numeric last segment of a version string to parse. Incorrect source version strings now raise an IllegalArgumentException better explaining the cause.

Related tickets: DATACMNS-496.
2015-06-22 11:34:04 +02:00
Oliver Gierke
6cf80fe84f DATACMNS-717 - AnnotatedTypeScanner now uses Environment and ResourceLoader configured.
We now implement EnvironmentAware and ResourceLoaderAware to respect the current environment setup when scanning for types. We use the ResourceLoader's ClassLoader if configured but indicate to fall back to the default one if none configured.
2015-06-18 17:45:11 +02:00
Oliver Gierke
e5d463b3c9 DATACMNS-715 - Repository factory now adds TransactionProxy interface if available.
We now leniently add the TransactionProxy marker interface to the repository proxy to opt-out of any further transaction handling potentially applied through @EnableTransactionManagement or its XML equivalent.

The interface will be introduced in Spring 4.1.7 / 4.2 RC2 so we're reflectively adding it if present. Might be something we can think of making less indirect for Fowler once 4.1.7 has been released.
2015-06-17 15:57:48 +02:00
Oliver Gierke
06e17ed320 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:10:38 +02:00
Oliver Gierke
fd9866284f 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:23:43 +02:00
阮杰锋
fefba205b1 DATACMNS-707 - Fixed typo in JavaDoc of CrudRepository
Changed from ( to { in JavaDoc of file CrudRepository.

Original pull request: #127.
2015-06-09 11:34:10 +02:00
Oliver Gierke
8842c91701 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:56:34 +02:00
Oliver Gierke
ec81344489 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:34:15 +02:00
Oliver Gierke
638822e6f7 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:01:09 +02:00
Tomasz Wysocki
3f08187a9f 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:28:38 +02:00
Oliver Gierke
8bb937ac35 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:46:01 +02:00
Oliver Gierke
f4a74265c5 DATACMNS-642 - Avoid setter lookup in BeanWrapper for if field access is used.
We now delay the lookup of the setter method until we discover we really  need to use property access.
2015-02-04 17:13:38 +01:00
Oliver Gierke
67697f64d6 DATACMNS-640 - Fixed potential NullPointerException in PageableHandlerMethodArgumentResolver.
We now double check the fallback Pageable for being null before trying to lookup the Sort to fall back.
2015-02-04 10:32:34 +01:00
Oliver Gierke
394d82ca8a DATACMNS-563 - Added explicit unit test for one-indexed parameters on PagedResourcesAssembler. 2015-01-30 14:46:11 +01:00
Oliver Gierke
0ea37b250c DATACMNS-632 - Prepare 1.8.5.RELEASE (Dijkstra SR5). 2015-01-27 14:38:52 +01:00
Oliver Gierke
ccd9cb09e4 DATACMNS-632 - Updated changelog. 2015-01-27 14:35:07 +01:00
Oliver Gierke
77f17b8c22 DATACMNS-637 - Performance improvements.
MappingContextTypeInformationMapper now caches detected type aliases.

PreferredConstructor.isEnclosingClassParameter(…) now eagerly returns if the parameter itself is not an enclosing one and thus avoids a collection lookup and equals check. Moved equals check for the type to the very end of the equals check to increase the chances that other inequality guards kick in earlier.

AbstractMappingContext now leaves the non-null-check for getPersistentEntity(…) to the factory method of ClassTypeInformation.

We now pre-calculate the hash codes for TypeInformation implementations as far as possible as the instances are used as cache keys quite a lot. The same applies to AbstractPersistentProperty.

BasicPersistentEntity now uses an ArrayList we sort during the verify() phase to mimic the previous behavior wich was implemented using a TreeSet as ArrayLists are way more performant when iterating over all elements which doWithProperties(…) is doing which is used quite a lot.

BeanWrapper now avoids the getter lookup if field access is used.

SimpleTypeHolder now uses a CopyOnWriteArrySet to leniently add types detected to be simple to the set of simple types to avoid ongoing checks against the inheritance hierarchy.
2015-01-25 17:46:00 +01:00
Oliver Gierke
3c0157dc1a DATACMNS-563 - Added unit tests to verify enabling one-indexed parameters are considered correctly when resolving Pageables. 2015-01-20 20:20:03 +01:00
Oliver Gierke
f359e936d7 DATACMNS-634 - Polishing.
Simplified type traversal in Repositories.getRepositoryFactoryInfoFor(…) and unit tests.

Original pull request: #110.
2015-01-20 17:55:25 +01:00
Thomas Eizinger
297688c9a9 DATACMNS-634 - Repositories now als returns repositories for super types of a domain class.
In case the repository lookup for a given domain type fails we traverse the given types super-types and try to detect a repository for those.

Original pull request: #110.
2015-01-20 17:55:16 +01:00
Oliver Gierke
dacf34e796 DATACMNS-621 - Polishing.
Simplified implementation of Path conversion. Inlined helper domain types to not to pollute the packages with types that are only used within that very one test class.

Original pull request: #111.
2015-01-20 16:36:22 +01:00
Christoph Strobl
0ce87189ce DATACMNS-621 - QSort now treats nested paths correctly.
We now inspect intermediate path elements to build sort order accordingly.

Original pull request: #111.
2015-01-20 16:27:12 +01:00
Oliver Gierke
332790009b DATACMNS-608 - Updated changelog. 2015-01-20 07:12:28 +01:00
Oliver Gierke
62d3bc168f DATACMNS-585 - Updated changelog. 2015-01-20 07:11:51 +01:00
Oliver Gierke
68a20ebc6e DATACMNS-572 - Updated changelog. 2015-01-20 07:11:13 +01:00
Oliver Gierke
b9916ab8b7 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:25:28 +01:00
Oliver Gierke
49a00cb5ec 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:58 +01:00
Oliver Gierke
6f4b26bf56 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:19 +01:00
Oliver Gierke
71f1592200 DATACMNS-601 - Fixes for most of the SonarQube warnings. 2014-11-26 09:15:34 +01:00
Oliver Gierke
0f448d509c 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:23 +01:00
Oliver Gierke
ca377dc075 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:30 +01:00
Thomas Darimont
e02cecd6d0 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:28 +01:00
Thomas Darimont
47e2c84bbc 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:49:16 +02:00
Thomas Darimont
494221064e DATACMNS-530 - Improve JavaDoc for RepositoryConfigurationSourceSupport.
Removed misleading JavaDoc.

Original pull request: #97.
2014-10-07 15:02:16 +02:00
Oliver Gierke
c3ad453eef DATACMNS-568 - Prepare 1.8.4.RELEASE (Dijkstra SR4). 2014-08-27 11:35:54 +02:00
Oliver Gierke
f1c668c5ca DATACMNS-568 - Updated changelog. 2014-08-27 11:28:04 +02:00
Oliver Gierke
0cd215e9b1 DATACMNS-561 - Updated changelog. 2014-08-27 07:11:22 +02:00
Thomas Darimont
8650b6943c 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:55 +02:00
Oliver Gierke
6daf7e2752 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:54:09 +02:00
Oliver Gierke
33698a7649 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:30:38 +02:00
Oliver Gierke
e62391f825 DATACMNS-558 - Some code cleanups according to the Sonar report. 2014-08-10 12:53:24 +02:00