Commit Graph

1390 Commits

Author SHA1 Message Date
Mark Paluch
ca34e4bd3e 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:58:59 +02:00
Oliver Gierke
5708d6af12 DATACMNS-1294 - Consider java.time types simple ones.
To prevent repeated failing calls to ClassUtils.forName(…) we now also cache the failed attempt and simply eagerly return null as subsequent similar attempts to resolve a class are going to fail anyway.

Original pull request: #286.
2018-04-18 18:51:47 +02:00
Oliver Gierke
8d99e0d83d DATACMNS-1301 - SimpleTypeInformationMapper.resolveTypeFrom(…) now caches failed resolution attempts.
To prevent repeated failing calls to ClassUtils.forName(…) we now also cache the failed attempt and simply eagerly return null as subsequent similar attempts to resolve a class are going to fail anyway.
2018-04-18 11:55:39 +02:00
Mark Paluch
1001f4e71f DATACMNS-1299 - Polishing.
Consider GeoResults as native wrapper to properly unwrap its component type.
2018-04-17 10:05:56 +02:00
Oliver Gierke
f3c138258b 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:29:50 +02:00
Oliver Gierke
0daac0c890 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:25:55 +02:00
Mark Paluch
48a7a023f8 DATACMNS-1257 - Updated changelog. 2018-04-13 15:11:27 +02:00
Chengyuan Zhao
567d665111 DATACMNS-1291 - Fix method signature in repository projection documentation.
Original pull request: #285.
2018-04-13 09:40:53 +02:00
Mark Paluch
f1860f3c14 DATACMNS-1291 - Polishing.
Typo fixes, align Enable…Repositories annotation wording, document reactive return types.

Original pull request: #281.
2018-04-13 09:30:05 +02:00
Jay Bryant
200e156de8 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:29:24 +02:00
Mark Paluch
f4070ce288 DATACMNS-1293 - Polishing.
Fix leftovers pointing to legacy Querydsl packages in Javadoc. Reformat code.

Original pull request: #284.
2018-04-12 14:32:52 +02:00
Robert Winkler
1f60389a36 DATACMNS-1293 - Fixed Querydsl package reference in QuerydslPredicateArgumentResolver Javadoc.
Original pull request: #284.
2018-04-12 14:31:17 +02:00
Mark Paluch
790a7e5f30 DATACMNS-1267 - Updated changelog. 2018-04-04 17:12:52 +02:00
Mark Paluch
f01607353b DATACMNS-1248 - After release cleanups. 2018-04-04 14:58:03 +02:00
Mark Paluch
797c746509 DATACMNS-1248 - Prepare next development iteration. 2018-04-04 14:58:02 +02:00
Mark Paluch
776cc0f4e6 DATACMNS-1248 - Release version 1.13.11 (Ingalls SR11). 2018-04-04 14:21:28 +02:00
Mark Paluch
d0d2b8658f DATACMNS-1248 - Prepare 1.13.11 (Ingalls SR11). 2018-04-04 14:20:47 +02:00
Mark Paluch
7ab6bd2745 DATACMNS-1248 - Updated changelog. 2018-04-04 14:20:38 +02:00
Oliver Gierke
371f6590c5 DATACMNS-1285 - PropertyPath now limits the depth of its parsing to 1000 segments. 2018-04-03 19:30:21 +02:00
Mark Paluch
999d26436b DATACMNS-1284 - Polishing.
Backport of 06116b7.

Related ticket: DATACMNS-1206.
Original commit: 06116b7.
2018-04-03 10:42:45 +02:00
Oliver Gierke
428b0decd5 DATACMNS-1284 - Polishing.
Backport of 5eb10a0 but leaving out the Stream execution optimizations.

Related ticket: DATACMNS-1206.
Original commit: 5eb10a0.
2018-04-03 10:41:17 +02:00
Mark Paluch
eed005427d DATACMNS-1281 - Backport of addition of 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.
Related tickets: DATACMNS-1206.
Original commit: 9e013d3.
2018-04-03 10:41:08 +02:00
Oliver Gierke
b1a20ae1e8 DATACMNS-1282 - Switched to SimpleEvaluationContext in MapDataBinder. 2018-03-28 09:02:38 +02:00
Oliver Gierke
4715675a38 DATACMNS-1283 - Removed explicit Jackson version declaration. 2018-03-27 19:20:29 +02:00
Oliver Gierke
8bbcca2ef2 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:58:04 +02:00
Mark Paluch
3527f195dc DATACMNS-1273 - Polishing.
Remove trailing whitespaces.
2018-03-05 09:45:08 +01:00
Mark Paluch
ada4498968 DATACMNS-1273 - Consider merged annotations when populating for annotation cache.
We now consider property annotations as merged annotations when initially scanning for annotations in a property declaration. Composed annotations such as declared outside our code are captured correctly because they use an own type that is not queried by users of PersistentProperty. Own, revised annotations, using @AliasFor providing an alias for annotation values require merged annotation processing.

Previously, annotations were cached as-is without resolving @AliasFor. This caused a later lookup via findAnnotation(…) to return the cached annotation without aliasing. Because the annotation was cached, no further lookup via AnnotatedElementUtils.findMergedAnnotation(…) was attempted.

@Retention(RetentionPolicy.RUNTIME)
@Target(value = { FIELD, METHOD })
public @interface RevisedAnnnotationWithAliasFor {

	@AliasFor("value")
	String name() default "";

	@AliasFor("name")
	String value() default "";
}

public class Person {
	@RevisedAnnnotationWithAliasFor(value = "spring")
	String firstname;
}

PersistentProperty firstname = …

property.findAnnotation(…) returned previously @RevisedAnnnotationWithAliasFor(value = "spring", name = "")

now we return @RevisedAnnnotationWithAliasFor(value = "spring", name = "spring")

Original ticket: DATACMNS-981.
Java 6 compatible backport of 2da5acc553.
2018-03-05 09:43:07 +01:00
Oliver Gierke
aadeebbb7d DATACMNS-1271 - Streamlined implementation of AnnotationBasedPersistentProperty to avoid NullPointerExceptions.
Java 6 compatible backport of 78d21327 and 7e7d4baa.
2018-03-02 11:08:34 +01:00
Mark Paluch
ce27abfff3 DATACMNS-1262 - Updated changelog. 2018-02-28 11:17:36 +01:00
Oliver Gierke
a09d6379e6 DATACMNS-1264 - MapDataBinder now rejects improper property expressions.
We now make sure that type expressions cannot be used in SpEL expressions handled by MapDataBinder. They're gonna be rejected by considering the property not writable. SpEL expression evaluation errors are now forwarded as NotWritablePropertyException to make sure the failure gets handled as if the property referred to doesn't exist.
2018-02-26 21:43:54 +01:00
Mark Paluch
ef88861852 DATACMNS-1250 - Updated changelog. 2018-02-19 20:30:04 +01:00
Christoph Strobl
0e3e0e9386 DATACMNS-1186 - Updated changelog. 2018-02-06 11:13:54 +01:00
Oliver Gierke
480294bb5c 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

Applied the same fixes to the deprecated Javaslang support. Removed some obsolete full qualifications of types.
2018-02-03 21:44:05 +01:00
Oliver Gierke
cb549e6f58 DATACMNS-1243 - Polishing.
Imports and author tags.

Original pull request: #268.
2018-02-01 11:02:49 +01:00
Jens Schauder
63577569bd DATACMNS-1243 - Add converters from LocalDateTime to Instant and back.
This allows usage of Instant for AuditAware.

Original pull request: #268.
2018-02-01 11:02:43 +01:00
Mark Paluch
796ae8543d DATACMNS-1220 - Updated changelog. 2018-01-24 13:41:22 +01:00
Mark Paluch
e9eacfceca DATACMNS-1249 - Fix line endings to LF. 2018-01-24 12:25:17 +01:00
Mark Paluch
d43274edfd DATACMNS-1219 - After release cleanups. 2018-01-24 12:08:50 +01:00
Mark Paluch
81c1d129af DATACMNS-1219 - Prepare next development iteration. 2018-01-24 12:08:50 +01:00
Mark Paluch
8ddb7cefe1 DATACMNS-1219 - Release version 1.13.10 (Ingalls SR10). 2018-01-24 12:08:50 +01:00
Mark Paluch
2fe0d62250 DATACMNS-1219 - Prepare 1.13.10 (Ingalls SR10). 2018-01-24 12:08:50 +01:00
Mark Paluch
2156578f06 DATACMNS-1219 - Updated changelog. 2018-01-24 12:08:46 +01:00
Oliver Gierke
69cb5c6653 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:27:57 +01:00
Marcel Overdijk
7c0ec77e40 DATACMNS-563 - PagedResourcesAssembler now correctly forwards one-index settings to PageMetadata.
Original pull request: #267.
2017-12-30 12:12:59 +01:00
Oliver Gierke
9a5cd29e3c 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:39:05 +01:00
Oliver Gierke
2985ff31ac 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 22:22:53 +01:00
Oliver Gierke
91954e1f0d DATACMNS-1229 - Upgrade to XmlBeam 1.4.14. 2017-12-01 15:21:13 +01:00
Oliver Gierke
8972d4b8bc DATACMNS-1227 - Polishing. 2017-12-01 13:50:47 +01:00
Oliver Gierke
0cbe0da3db DATACMNS-1227 - Add documentation section about JSONPath- and XPath-based web data binding. 2017-12-01 13:50:47 +01:00
Mark Paluch
050a818c71 DATACMNS-1202 - Updated changelog. 2017-11-27 16:43:42 +01:00