Commit Graph

1012 Commits

Author SHA1 Message Date
Mark Paluch
08764e1f71 DATACMNS-1250 - Prepare 2.0.4 (Kay SR4). 2018-02-19 19:46:04 +01:00
Mark Paluch
d4eda31bde DATACMNS-1250 - Updated changelog. 2018-02-19 19:45:53 +01:00
Oliver Gierke
0dae46fb6f DATACMNS-1259 - Polishing.
Removed unnecessary imports. Tiny refactoring to pull exception creation into static helper method. Made methods static in test cases where possible.

Original pull request: #273.
2018-02-15 14:37:05 +01:00
Jens Schauder
dc24d2cedd DATACMNS-1259 - Polishing.
Refactored lambdas to method references. Simplified type parameter. Added comment to test to indicate related issue.

Original pull request: #273.
2018-02-15 14:37:02 +01:00
Jens Schauder
c6e50d3c8f DATACMNS-1259 - Fixed support for Long values in Auditables.
Using Instant as internal data type since it's a point in time without time zone which LocalDateTime isn't. Added necessary converters. Fixed one JodaTime converter that used UTC to use SystemDefault like other similar converters.

In case of a conversion failure the error message now contains the source type.

Original pull request: #273.
2018-02-15 14:36:59 +01:00
Christoph Strobl
0b524e1f53 DATACMNS-1186 - Updated changelog. 2018-02-06 11:13:57 +01:00
Oliver Gierke
30033b22bc DATACMNS-1252 - Improved Vavr collection handling to convert between collection types.
If a query method now uses e.g. a Vavr Set as return type, we now also use a potential source List as input for the LinkedHashSet, even if that changes the characteristics (duplicate policy etc.) of the result. This is consistent with our general handling of collections as we're using a Spring ConversionService for collection mapping anyway.

In general the new conversion algorithm is driven by the expected target type first:

- i.v.c.Seq -> i.v.c.List
- i.v.c.Set -> i.v.c.LinkedHashSet
- i.v.c.Map -> i.v.c.LinkedHashMap

If none of the declared types is assignable we fall back to the previous algorithm choosing an implementation as close as possible to the original source value:

- j.u.List -> i.v.c.List
- j.u.Set  -> i.v.c.LinkedHashSet
- j.u.Map  -> i.v.c.LinkedHashMap

Removed some obsolete full qualifications of types.
2018-02-03 21:43:47 +01:00
Oliver Gierke
66224b3cb1 DATACMNS-1243 - Polishing.
Imports and author tags.

Original pull request: #268.
2018-02-01 10:55:43 +01:00
Jens Schauder
0e9f150fa8 DATACMNS-1243 - Add converters from LocalDateTime to Instant and back.
This allows usage of Instant for AuditAware.

Original pull request: #268.
2018-02-01 10:55:43 +01:00
Mark Paluch
5909b76026 DATACMNS-1220 - Prepare 2.0.3 (Kay SR3). 2018-01-24 13:20:39 +01:00
Mark Paluch
76d8725353 DATACMNS-1220 - Updated changelog. 2018-01-24 13:20:30 +01:00
Mark Paluch
a387355b70 DATACMNS-1249 - Fix line endings to LF. 2018-01-24 12:30:32 +01:00
Mark Paluch
0f76b837e2 DATACMNS-1219 - Updated changelog. 2018-01-24 12:22:05 +01:00
Mark Paluch
d14133bfdc DATACMNS-1245 - Consider Kotlin metadata annotation for Kotlin class kind retrieval.
We now inspect Kotlin's Metadata annotation to determine the kind of a Kotlin class.

Previously we used Kotlins internal API to introspect classes. Because this API is not public and can be changed at any time we rely on Kotlins annotations as they are supposed to not change in near future.

Original pull request: #269.
2018-01-19 13:39:17 +01:00
Oliver Gierke
b7e7615c75 DATACMNS-1246 - Minor optimization in QueryExecutorMethodInterceptor.
We now prevent the superfluous creation of a MethodParameter and TypeDescriptor instance in repository method execution in case the value to be returned already is an instance of the expected method return type.
2018-01-18 17:22:51 +01:00
Oliver Gierke
b5e79798e8 DATACMNS-1242 - Reduced log output for test execution. 2018-01-10 12:09:16 +01:00
Mark Paluch
6bb7e2b061 DATACMNS-1236 - Fix inconsistent Pageable nullability Javadoc.
Fix Javadoc to reflect Pageable's non-nullability. Also, remove pageable field in favor of using Chunk's Pageable getter.
2018-01-09 12:46:56 +01:00
Oliver Gierke
c93e647eeb DATACMNS-563 - Polishing.
Removed obsolete generics. Rearranged some code for better readability.

Original pull request: #267.
2017-12-30 12:14:01 +01:00
Marcel Overdijk
111f43634f DATACMNS-563 - PagedResourcesAssembler now correctly forwards one-index settings to PageMetadata.
Original pull request: #267.
2017-12-30 12:09:31 +01:00
Oliver Gierke
d05312327a DATACMNS-1238 - Optimize setting Environment on ClassPathScanningCandidateComponentProvider.
In CustomRepositoryImplementationDetector, we now immediately hand the Environment to the constructor of ClassPathScanningCandidateComponentProvider instead of setting it afterwards. This prevents a default StandardEnvironment from being created in the previously used constructor.
2017-12-30 11:34:51 +01:00
Oliver Gierke
05de55ffba DATACMNS-1237 - Register additional ProxyingHandlerMethodArgumentResolver as first resolver.
We now deploy a custom BeanPostProcessor to customize RequestMappingHandlerAdapter instances by prepending a ProxyingHandlerMethodArgumentResolver (requiring a @ModelAttribute) to the list of resolved HandlerMethodArgumentResolvers to make sure the settings defined in the annotation are applied but the projecting way of data binding is still used.
2017-12-20 23:13:52 +01:00
Oliver Gierke
c652b487d6 DATACMNS-1227 - Polishing. 2017-12-01 13:50:32 +01:00
Oliver Gierke
b4ae96de1b DATACMNS-1227 - Add documentation section about JSONPath- and XPath-based web data binding. 2017-12-01 13:50:32 +01:00
Oliver Gierke
e537f5c4b9 DATACMNS-1224 - Polishing of nullability annotations.
Refactored code to properly check for null fields in Eclipse. Added warning suppressions where suitable.
2017-11-30 00:29:35 +01:00
Mark Paluch
9b3be379d8 DATACMNS-1202 - Prepare 2.0.2 (Kay SR2). 2017-11-27 16:11:21 +01:00
Mark Paluch
8b902f6c78 DATACMNS-1202 - Updated changelog. 2017-11-27 16:11:12 +01:00
Mark Paluch
54d349f2b9 DATACMNS-1195 - Updated changelog. 2017-11-27 15:58:44 +01:00
Oliver Gierke
65772eb515 DATACMNS-1158 - Polishing.
Some code reorganization, polishing of nullable annotations, JavaDoc.

Original pull request: #243.
Related issue: DATAJPA-1173.
2017-11-24 11:07:18 +01:00
Jens Schauder
27279295a8 DATACMNS-1158 - ProjectionFactory is now configurable by module implementations.
Introduced RepositoryFactorySupport.getProjectionFactory(…) to create a ProjectionFactory to be used for repository instances created. The default implementation uses the SpelAwareProxyProjectionFactory.

The ProjectionInformation implementation is now a named class so it can be used for more specialized implementations.

Original pull request: #243.
Related issue: DATAJPA-1173.
2017-11-24 11:07:18 +01:00
Oliver Gierke
1e5aad94cf DATACMNS-1215 - Fixed repository lookup for proxy domain classes.
We now consistently use the user class for repository (metadata) lookup in Repositories.
2017-11-17 10:18:49 +01:00
Oliver Gierke
39c67e3fef DATACMNS-1214 - Fixed AbstractMappingContext.getPersistentEntity(PersistentProperty) to now return null for non-entities.
Previously, a call to AbstractMappingContext.getPersistentEntity(PersistentProperty) would've added potentially leniently added the type of the given PersistentProperty, no matter whether it's actually considered to be an entity in the first place. We now defensively check for whether the given property is to be considered an entity (taking potentially registered converters into account) before the potentially entity-creating by-type lookup.
2017-11-16 16:36:48 +01:00
Oliver Gierke
875cb11db1 DATACMNS-1208 - AbstractMappingContext.hasPersistentEntityFor(…) now properly considers cached absence.
AbstractMappingContext.hasPersistentEntityFor(…) now also properly consideres the empty Optional as non-presence as that is held to allow to distinguish between a type completely unkown to the context, or already known but not considered a persistent entity.

Related pull request: #258.
2017-11-14 10:01:21 +01:00
Oliver Gierke
2f3041f61f DATACMNS-1185 - Prepare 2.0.1 (Kay SR1). 2017-10-27 15:24:24 +02:00
Oliver Gierke
2462d1b0b3 DATACMNS-1185 - Updated changelog. 2017-10-27 15:24:09 +02:00
Oliver Gierke
25333d2d40 DATACMNS-1180 - Polishing.
Avoid premature resolution of type in TypeDiscoverer.createInfo(…) and thereby simplify constructor in ParameterizedTypeInformation.
2017-10-27 10:47:31 +02:00
Oliver Gierke
4d45440513 DATACMNS-1180 - Fixed accessor lookup for generic properties.
In AbstractPersistentProperty, we now resolve the potentially generic return and parameter types of getters and setters. To achieve that Property has now been made aware of the actual owning type.
2017-10-27 10:47:31 +02:00
Mark Paluch
edd8c5b8a3 DATACMNS-1201 - Support generated property accessors for types in default packages.
We now support generated property accessors for types that reside in the default package.

Original pull request: #256.
2017-10-25 09:10:15 +02:00
Oliver Gierke
26da224081 DATACMNS-1200 - Polishing.
Left-over whitepspace.

Original pull request: #255.
2017-10-19 12:15:13 +02:00
Mark Paluch
fdafe96c5c DATACMNS-1200 - Fix entity instantiation of Kotlin types using primitives with default values.
We now determine initial values for primitive parameters in Kotlin constructors that are absent (null) and defaulted. We default all Java primitive types to their initial zero value to prevent possible NullPointerExceptions. Kotlin defaulting uses a bitmask to determine which parameter should be defaulted but still requires the appropriate type.

Previously, null values were attempted to cast/unbox and caused NullPointerException even though they had default values through Kotlin assigned.

Original pull request: #255.
2017-10-19 12:15:12 +02:00
Mark Paluch
c6d880309d DATACMNS-1200 - Polishing.
Throw MappingInstantiationException from KotlinClassGeneratingEntityInstantiator if instantiation fails to align behavior with ClassGeneratingEntityInstantiator. Report Kotlin constructor instead of Java constructor if available.

Original pull request: #255.
2017-10-19 12:15:12 +02:00
Mark Paluch
f45e2be383 DATACMNS-1200 - Guard casts to primitive type in ClassGeneratingEntityInstantiator.
We now insert assertions for primitive types before passing these to the actual constructor to prevent NullPointerExceptions. We also output the index/parameter name if the parameter was null.

Original pull request: #255.
2017-10-19 12:15:12 +02:00
Oliver Gierke
d1fc97ea75 DATACMNS-1197 - Polishing.
Some cleanups in KorlinReflectionUtils. Removed compiler warnings about nullability and raw types.

Original pull request: #254.
2017-10-13 17:45:41 +02:00
Mark Paluch
5cf4ba2e5f DATACMNS-1197 - Resolve Kotlin interface properties for nullability inspection.
We now resolve Kotlin interface properties to inspect these for nullability. Kotlin-reflect does not resolve interface property accessors yet so we need to handle this aspect ourselves.

Related ticket: https://youtrack.jetbrains.com/issue/KT-20768.
Original pull request: #254.
2017-10-13 17:45:41 +02:00
Oliver Gierke
691573d143 DATACMNS-1196 - Fixed generics lookup for nested generics in ParameterizedTypeInformation.
We now eagerly resolve a generics declaration chain, which we previously - erroneously - expected GenericTypeResolver to do for us. Simplified TypeVariableTypeInformation implementation. Renamed ParameterizedTypeUnitTests to ParameterizedTypeInformationUnitTests.
2017-10-12 18:19:05 +02:00
Oliver Gierke
52f2259371 DATACMNS-1155 - Updated changelog. 2017-10-11 19:03:23 +02:00
Oliver Gierke
69562532a6 DATACMNS-1190 - Polishing the polishing.
Slight rewording. Extracted path to Spring Framework JavaDoc into variable.

Original pull request: #253.
2017-10-11 15:53:36 +02:00
Mark Paluch
a814b114e6 DATACMNS-1190 - Polishing.
Remove existing section on Null-safety. Augment Null handling section with bits of the previous documentation, explicitly describe annotations expressing null-constraints, include full-qualified imports, mention kotlin-reflect dependency for Kotlin metadata introspection. Align callouts, add links, slightly improve wording, typos. Extend year range in copyright header.

Original pull request: #253.
2017-10-11 15:53:36 +02:00
Oliver Gierke
757f7adf24 DATACMNS-1190 - Added section on how to enforce nullability constraints on repositories.
Original pull request: #253.
2017-10-11 15:53:36 +02:00
Oliver Gierke
ccd8e2a209 DATACMNS-901 - AbstractMappingContext publishes entity added events outside the write lock.
Previously, the publication of the event that indicated a PersistentEntity having been added to it took place before the write lock over the entities had been released. We now keep the lock smaller and publish the addition event *after* the lock has been released.
2017-10-10 16:38:51 +02:00
stonio
47c2a40228 DATACMNS-1193 - Fixed typo in JavaDoc and reference documentation of PageableDefaults.
Original pull request: #218.
2017-10-10 15:05:47 +02:00