Commit Graph

1065 Commits

Author SHA1 Message Date
Mark Paluch
27945c3483 DATACMNS-1313 - Prepare 2.0.8 (Kay SR8). 2018-06-13 15:12:06 +02:00
Mark Paluch
26fae4b73c DATACMNS-1313 - Updated changelog. 2018-06-13 15:11:54 +02:00
Mark Paluch
e548cb874f DATACMNS-1312 - Updated changelog. 2018-06-13 15:01:57 +02:00
Mark Paluch
3ea24a1976 DATACMNS-1338 - Calculate defaulting mask count in Kotlin default constructor resolution.
We now calculate the number of expected default masks to filter synthetic constructors that do not match the expected parameter count. A Kotlin constructor with argument defaulting generates a synthetic integer argument for every 32 constructor arguments. This is independent of the number of actual optional arguments.

Previously, we used an non-exact check to consider constructors as default ones if they had at least two additional arguments. This caused the wrong constructor being used if the non-synthetic types matched the types of the default constructor.
2018-06-10 17:22:41 +02:00
Oliver Gierke
74703385fb DATACMNS-1336 - Avoid warning logs for JodaTime and ThreeTenBP converter registrations.
Removed the explicit registration for JodaTime and ThreeTenBP to JSR-310 converters (originally introduced to support the unifying lookup of the last modified date in the auditing subsystem) as reading converters. This avoids the warning reporting that the source types (JodaTime and ThreeTenBP LocalDateTime) not being store-native types (which usually indicates a superfluous converter registration).

Updated the test cases to make sure these warnings aren't trigger due to test setups causing the same issue.
2018-06-06 14:05:19 +02:00
Oliver Gierke
81ae0c9943 DATACMNS-1304 - Polishing.
Moved test cases into PropertyPathUnit test so that they're closer to the implementation. Switched to Introspector.decapitalize(…) to follow the Java Beans Specification regarding the handling of all-uppercase properties.

Original pull request: #289.
2018-06-05 18:55:36 +02:00
Mariusz Mączkowski
a33b9e3300 DATACMNS-1304 - PropertyPath now supports properties with all uppercase endings.
Original pull request: #289.
2018-06-05 18:55:35 +02:00
Jens Schauder
2c2713ff98 DATACMNS-1327 - Polishing.
Added comments to tests for indicating the original issue.
2018-06-01 12:55:47 +02:00
Alex Bondarev
d6f39afe00 DATACMNS-1327 - Prevent int overflow in AbstractPageRequest#getOffset().
Original pull request: #291.
2018-06-01 12:55:47 +02:00
Oliver Gierke
fffce66bdd DATACMNS-1328 - DefaultRepositoryInvokerFactory now uses a ConcurrentHashMap.
We now use ConcurrentHashMap to prevent ConcurrentModificationExceptions in multithreaded access to repository invokers.
2018-05-31 10:28:37 +02:00
Oliver Gierke
5ecb550039 DATACMNS-1326 - PersistentPropertyInspectingIsNewStrategy now considers primitive type's defaults.
PersistentPropertyInspectingIsNewStrategy now considers entities with primitive default identifier values new.
2018-05-18 23:53:26 +02:00
Oliver Gierke
7bd7afe6fb DATACMNS-1325 - Added dedicated identifier accessor for Persistable entities.
BasicPersistentEntity now returns a dedicated IdentifierAccessor that uses Persistable.getId() in case the entity implements Persistable.
2018-05-18 23:53:17 +02:00
Oliver Gierke
0d31ab693d DATACMNS-1324 - Introduced extensible proxy detection infrastructure.
Introduced ProxyUtils.getUserClass(…) that by default is basically a facade for Spring's ClassUtils.getUserClass(…) but allows the registration of ProxyDetector implementations via Spring's SpringFactoriesLoader mechanism.

Moved all existing usages of ClassUtils.getUserClass(…) to ProxyUtils.
2018-05-17 16:23:15 +02:00
Christoph Strobl
6bf952dbd5 DATACMNS-1295 - Updated changelog. 2018-05-17 10:32:55 +02:00
Jay Bryant
694a799e3c DATACMNS-1315 - Added a cover page for epub output.
I added a cover page for the epub output, now that the Spring data reference guides will have epub output (through a commit against spring-data-build).

Original pull request: #290.
2018-05-11 16:43:26 +02:00
Mark Paluch
eb1470618e DATACMNS-1288 - Prepare 2.0.7 (Kay SR7). 2018-05-08 14:14:32 +02:00
Mark Paluch
84fcd32fab DATACMNS-1288 - Updated changelog. 2018-05-08 14:14:20 +02:00
Mark Paluch
efd54edd03 DATACMNS-1287 - Updated changelog. 2018-05-08 12:22:49 +02:00
Oliver Gierke
fd94d3145d DATACMNS-1292 - Improved default setup of XMLBeam.
We now explicitly disable entity expansion in the DocumentBuilderFactory used by XMLBeam.

Introduced constructor in XmlBeamHttpMessageConverter to allow dedicated configuration of an XBProjector instance in case the defaults need tweaking and augmented the web configuration setup to automatically pick up a custom XmlBeamHttpMessageConverter bean instead of our own default if present.
2018-05-08 09:52:55 +02:00
Mark Paluch
c9a4ab7c05 DATACMNS-1294 - Enforce JSR-310 type mapping to java.util.Date.
After considering JSR-310 types to be simple we map these types primarily to java.util.Date as the majority of stores does not natively support JSR-310 types. Converters referencing JSR-310 types are now properly annotated with Reading/WritingConverter annotations to distinguish between reading and writing intents.

Othwerise, converters between JSR-310/java.util types and Joda/ThreeTenBackport to JSR-310 types interfere with conversion as regular java.util.Date types would convert to e.g. LocalDateTime.
2018-04-19 09:56:22 +02:00
Mark Paluch
a00935f66d DATACMNS-1294 - Consider java.time types simple ones.
We now consider all types in the java.time package as simple types to prevent deep reflective access. We are already excluding java.lang types for the same reason.

Original pull request: #286.
2018-04-18 18:54:10 +02:00
Mark Paluch
bc139744be DATACMNS-1299 - Polishing.
Consider GeoResults as native wrapper to properly unwrap its component type.
2018-04-17 09:58:53 +02:00
Oliver Gierke
64c6646172 DATACMNS-1300 - Improved collection query detection for Iterables.
Previously a custom Iterable implementation would've caused QueryMethod.isCollectionQuery() to return true. We now solely rely on TypeInformation.isCollectionLike() (which checks for exact Iterable, Collection assignability and arrays) after handling potential wrapper types.
2018-04-16 16:21:27 +02:00
Oliver Gierke
495cd2010b DATACMNS-1299 - QueryExecutionsConverters now don't unwrap custom Iterable implementations.
Instead of a simple check for assignability from Iterable, we now properly use TypeInformation.isCollectionLike(), which checks for Iterable equality or assignability of collections or arrays as well as an explicit check for Slice as that is needed to properly unwrap Page instances and Slices themselves. That prevents custom domain types implementing Iterable from being unwrapped into their element types.
2018-04-16 16:21:25 +02:00
Mark Paluch
d24e48b8f2 DATACMNS-1257 - Updated changelog. 2018-04-13 15:11:29 +02:00
Chengyuan Zhao
e1ec4bc17b DATACMNS-1291 - Fix method signature in repository projection documentation.
Original pull request: #285.
2018-04-13 09:40:48 +02:00
Mark Paluch
ca27ebd39d DATACMNS-1291 - Polishing.
Typo fixes, align Enable…Repositories annotation wording, document reactive return types.

Original pull request: #281.
2018-04-13 09:25:54 +02:00
Jay Bryant
00d752052e DATACMNS-1291 - Documentation full editing pass.
Edited for spelling, punctuation, grammar, and corporate voice. Also added cross-references in a few places.

Original pull request: #281.
2018-04-13 09:25:54 +02:00
Mark Paluch
03317d01c0 DATACMNS-1293 - Polishing.
Fix leftovers pointing to legacy Querydsl packages in Javadoc. Reformat code.

Original pull request: #284.
2018-04-12 14:34:14 +02:00
Robert Winkler
6f73508f57 DATACMNS-1293 - Fixed Querydsl package reference in QuerydslPredicateArgumentResolver Javadoc.
Original pull request: #284.
2018-04-12 14:30:55 +02:00
Mark Paluch
c79ba45e07 DATACMNS-1290 - Polishing.
Replace lambdas with method references.

Original pull request: #282.
2018-04-09 11:24:52 +02:00
Jens Schauder
1db151ac04 DATACMNS-1290 - Added support for timestamp values of type long.
The type long or Long is actually required for custom revision entities by Envers.

See also: https://github.com/spring-projects/spring-data-envers/issues/122
Original pull request: #282.
2018-04-09 11:24:07 +02:00
Oliver Gierke
500a1c627d DATACMNS-1289 - Polishing.
Original pull request: #280.
2018-04-06 17:48:14 +02:00
Mark Paluch
532af1a6b9 DATACMNS-1289 - Allow fragment creation only from implementations that implement their declared class.
We now check that fragment implementations created via RepositoryFragment.implemented(Class<T>, T) are a subtype of the given class. This assertion raises an exception that prevents errors during runtime.

This change addresses an issue with customized intermediate base repositories in combination with ambiguous naming of implementations. Method invocations fail if a repository derives from a customized base repository interface that implements e.g. CrudRepository and there's an implementation matching the base repository name followed by the implementation suffix. We assume in that case, the implementation contains implementations of the methods declared in the customized base interface.

Original pull request: #280.
2018-04-06 17:47:55 +02:00
Mark Paluch
e058845610 DATACMNS-1267 - Prepare 2.0.6 (Kay SR6). 2018-04-04 15:52:31 +02:00
Mark Paluch
fbd7a42f33 DATACMNS-1267 - Updated changelog. 2018-04-04 15:52:19 +02:00
Mark Paluch
d7661f9d70 DATACMNS-1248 - Updated changelog. 2018-04-04 15:16:19 +02:00
Oliver Gierke
7efaa1b18a DATACMNS-1263 - Polishing.
Fixed nullability constraints on method RepositoryConfigurationExtensionSupport.loadRepositoryInterface(…). Tweaked method declaration order to have public methods first, protected methods after that. Fixed a tiny typo.

Original pull request: #276.
2018-04-04 09:23:39 +02:00
Mark Paluch
8507a1265e DATACMNS-1263 - Allow configuration inspection-classloader customization.
We now allow customizing the configuration inspection-classloader with RepositoryConfigurationExtensionSupport.getConfigurationInspectionClassLoader(…). Subclasses may override this method if a customized/isolated classloader is required.

Original pull request: #276.
2018-04-04 09:22:19 +02:00
Oliver Gierke
3d8576fe4e DATACMNS-1285 - PropertyPath now limits the depth of its parsing to 1000 segments. 2018-04-03 19:44:44 +02:00
Mark Paluch
7ddd0ecac5 DATACMNS-1206 - Polishing.
Convert type array to string to construct the exception message. Slight Javadoc tweaks. Reduce method visibility. Simplify hasDefaultGetter check. Remove superfluous throws declaration. Strip trailing whitespaces. Ignore property descriptors without getter (e.g. indexed properties).

Original pull request: #263.
2018-04-03 09:31:18 +02:00
Oliver Gierke
55f9f04c8f DATACMNS-1206 - Polishing.
Moved PropertyDescriptor lookup into dedicated subclass to group functionality around the type and MethodsMetadata instances. Extracted individual stream handling steps into dedicated methods for better understandability.

Moved MethodsMetadataReader into classreading package for symmetry with Spring Framework's metadata arrangement. Removed manually declared getters in DefaultMethodsMetadataReader in favor of Lombok getters. Inlined MethodsMetadataReadingVisitor into DefaultMethodsMetadataReader as it's only used there.

Original pull request: #263.
2018-04-03 09:31:10 +02:00
Mark Paluch
0883eb9b9c DATACMNS-1206 - Add API to read methods in declaration order.
We now provide MethodsMetadataReader to read method metadata from a class file. MethodMetadata is read for all user-declared methods except for constructors (which are technically methods, too).

MethodsMetadataReaderFactory factory = new MethodsMetadataReaderFactory();
MethodsMetadataReader metadataReader = factory.getMetadataReader("com.acme.Foo");
MethodsMetadata metadata = metadataReader.getMethodsMetadata();

This new API is now used by DefaultProjectionInformation to make sure the order of input properties is based on the declaration order in the projection interfaces. Previously that order could not be guaranteed to be stable.

Original pull request: #263.
2018-04-03 09:30:58 +02:00
Oliver Gierke
ae1dd2741c DATACMNS-1282 - Switched to SimpleEvaluationContext in MapDataBinder. 2018-03-27 16:22:06 +02:00
Oliver Gierke
b0dc8be7f0 DATACMNS-1281 - Fixed potential concurrency issue in MappingAuditableBeanWrapperFactory.
We now use a ConcurrentReferenceHashMap to cache the metadata calculated to prevent ConcurrentModificationExceptions getBeanWrapperFor(…).
2018-03-27 15:59:21 +02:00
Gemini Kim
2e28afb4c7 DATACMNS-1280 - Fixed letter-casing in documentation of Querydsl Extension.
Original pull request: #279.
2018-03-19 11:56:11 +01:00
Oliver Gierke
e21db26bd9 DATACMNS-1278 - Make sure that SimpleTypeHolder always treats enums as simple.
We now explicitly check for an enum type in SimpleTypeHolder.isSimpleType(…) and resort to true immediately. Before that an enum implementing an interface could have seen a false for the actual enum type in case the interface type had been checked first and (correctly) produced a false. In the check for the actual enum type, depending on the iteration order through the cached values we could've hit the cached false for the interface or the cached true value for Enum.
2018-03-12 10:47:38 +01:00
Oliver Gierke
553eefa480 DATACMNS-1277 - Fix invocation of redeclared delete(…) method in ReflectionRepositoryInvoker.
As a consequence of our renaming efforts in CRUD methods, we lost some generics lookup information to distinguish deleteById(ID) from delete(T) solely based on the method parameter type in case of an intermediate generic repository redeclaring the method as the bound is now expanded to Object and not Serializable, as it did in 1.x.

We now rather check for the method name ending in …ById which is much simpler anyway.
2018-03-08 11:41:15 +01:00
Mark Paluch
7e7d4baa31 DATACMNS-1271 - Polishing.
Use ConcurrentHashMap in AnnotationBasedPersistentProperty for thread-safe annotation caching. Reintroduce eager cache check to prevent lambda instances on positive cache hits.
2018-03-01 16:27:43 +01:00
Oliver Gierke
78d21327bb DATACMNS-1271 - Streamlined implementation of AnnotationBasedPersistentProperty to avoid NullPointerExceptions.
We now use the annotation cache's ….computeIfAbsent(…) to avoid inconsistencies between ….contains(…) and ….get(…) in multi-threaded scenarios.
2018-03-01 16:27:42 +01:00