Commit Graph

1650 Commits

Author SHA1 Message Date
Oliver Gierke
8ea335a505 DATACMNS-1311 - Upgraded to XMLBeam 1.4.15.
Related tickets: DATACMNS-1292.
2018-05-08 10:22:53 +02:00
Oliver Gierke
b8974a292a 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:35 +02:00
Mark Paluch
4a7bb4853b 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:14 +02:00
Mark Paluch
2d24acf9de 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:53:59 +02:00
Mark Paluch
d85e9e117e DATACMNS-1299 - Polishing.
Consider GeoResults as native wrapper to properly unwrap its component type.
2018-04-17 09:58:41 +02:00
Oliver Gierke
3676ae0c87 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:19:58 +02:00
Oliver Gierke
5986b4b7af 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:11:01 +02:00
Mark Paluch
5f37a3af95 DATACMNS-1257 - After release cleanups. 2018-04-13 15:08:33 +02:00
Mark Paluch
64aa036dd1 DATACMNS-1257 - Prepare next development iteration. 2018-04-13 15:08:32 +02:00
Mark Paluch
870554aef7 DATACMNS-1257 - Release version 2.1 M2 (Lovelace). 2018-04-13 14:30:57 +02:00
Mark Paluch
5a0904090a DATACMNS-1257 - Prepare 2.1 M2 (Lovelace). 2018-04-13 14:30:01 +02:00
Mark Paluch
3600f611ea DATACMNS-1257 - Updated changelog. 2018-04-13 14:29:49 +02:00
Chengyuan Zhao
39b82e4ce6 DATACMNS-1291 - Fix method signature in repository projection documentation.
Original pull request: #285.
2018-04-13 09:39:27 +02:00
Mark Paluch
0dfcfe4186 DATACMNS-1291 - Polishing.
Typo fixes, align Enable…Repositories annotation wording, document reactive return types.

Original pull request: #281.
2018-04-13 09:25:29 +02:00
Jay Bryant
4da35a8f32 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:29 +02:00
Mark Paluch
666447a4c8 DATACMNS-1293 - Polishing.
Fix leftovers pointing to legacy Querydsl packages in Javadoc. Reformat code.

Original pull request: #284.
2018-04-12 14:34:24 +02:00
Robert Winkler
6275ded50f DATACMNS-1293 - Fixed Querydsl package reference in QuerydslPredicateArgumentResolver Javadoc.
Original pull request: #284.
2018-04-12 14:33:15 +02:00
Oliver Gierke
170c25d355 DATACMNS-1274 - Auditing now can set metadata in nested objects.
Based on the new infrastructure created by DATACMNS-1275, MappingAuditingMetadata now keeps PersistentPropertyPaths to point to the properties reflecting individual auditing metadata items rather than just PersistentPropertyPaths. With that in place we can now find those items in embedded types of the subject entity based on the detection setup of the MappingContext managing metadata for the entity.

As that means that multiple paths to a metadata item property can be found, we now use the first path found (the shortest one) for the lookup of the modification date.

Related tickets: DATACMNS-1275.
2018-04-09 14:31:20 +02:00
Oliver Gierke
ac324b22a5 DATACMNS-1275 - Introduced MappingContext.findPersistentPropertyPaths(Class<?>, Predicate<P>).
MappingContext now exposes a method to detect all property paths pointing to properties matching a given predicate.

Extracted PersistentPropertyPath creation into a dedicated factory class so that it can be tested individually. DefaultPersistentPropertyPath now exposes a ….containsPropertyOfType(…) to detect whether we've already processed a particular type in the path. Also applied a bit of Java 8 and Lombok polish.

InvalidPersistentPropertyPath now collects suggested alternatives to create a better exception message. PersistentEntities now allows to map over a MappingContext and PersistentEntity that a given type is corresponding to. Streamable now exposes an ….isEmpty(). Removed references to equivalent methods implemented in subtypes.
2018-04-09 14:31:20 +02:00
Jens Schauder
5901a27130 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:12:37 +02:00
Oliver Gierke
5e2e51b7a0 DATACMNS-1289 - Polishing.
Original pull request: #280.
2018-04-06 17:46:06 +02:00
Mark Paluch
142c9ddb5c 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:46:04 +02:00
Mark Paluch
d8a1c2cfde DATACMNS-1267 - Updated changelog. 2018-04-04 17:12:50 +02:00
Mark Paluch
d15a379c7b DATACMNS-1248 - Updated changelog. 2018-04-04 15:16:18 +02:00
Oliver Gierke
06b0dab536 DATACMNS-1285 - PropertyPath now limits the depth of its parsing to 1000 segments. 2018-04-03 19:27:16 +02:00
Oliver Gierke
6293ff325b DATACMNS-1283 - Removed explicit Jackson version declaration. 2018-03-27 19:17:12 +02:00
Oliver Gierke
08d748a6fd DATACMNS-1282 - Switched to SimpleEvaluationContext in MapDataBinder. 2018-03-27 16:21:58 +02:00
Oliver Gierke
73103f3551 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:14 +02:00
Gemini Kim
ac63f08614 DATACMNS-1280 - Fixed letter-casing in documentation of Querydsl Extension.
Original pull request: #279.
2018-03-19 11:55:12 +01:00
Mark Paluch
60d5426c7e DATACMNS-1255 - Polishing.
Introduce create(…) method as utility that centralizes code that would live in the modules otherwise. This method is a shortcut that creates the repository factory using Supplier, configures the factory with CdiRepositoryConfiguration settings, collects repository fragments and creates the actual repository implementation.

Related pull request: #272.
2018-03-12 14:58:53 +01:00
Oliver Gierke
0f174f6867 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:26 +01:00
Oliver Gierke
91c7d1b199 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:35:50 +01:00
Mark Paluch
c068ab679c 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:25:06 +01:00
Oliver Gierke
32ea1f77c0 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:25:06 +01:00
Mark Paluch
ff22d0cda5 DATACMNS-1262 - Updated changelog. 2018-02-28 11:17:34 +01:00
Oliver Gierke
613cf08f72 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:30:54 +01:00
Oliver Gierke
3dff7ead22 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-02-26 15:22:39 +01:00
Mark Paluch
f827ec705e 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-02-26 15:22:31 +01:00
Mark Paluch
8fb5e783e4 DATACMNS-1250 - Updated changelog. 2018-02-19 20:30:02 +01:00
Mark Paluch
0a3b71f0a1 DATACMNS-1233 - Allow CDI Repositories to be composed of an arbitrary number of implementation classes.
We now support repository fragments for repositories exported through CDI.

Original pull request: #272.
2018-02-16 18:32:37 +01:00
Mark Paluch
919090bf20 DATACMNS-1255 - Extend configuration of CDI repository settings.
We now extended CDI repository configuration to allow configuration of EvaluationContextProvider, NamedQueries, QueryLookupStrategy keys and the repository base class. CdiRepositoryConfiguration is now an interface with default-methods only providing default configuration values.

Original pull request: #272.
2018-02-16 18:32:05 +01:00
Mark Paluch
036ccde5ce DATACMNS-1255 - Polishing.
Add default QueryLookupStrategy key lookup method to CdiRepositoryConfiguration to not break existing modules by forcing these to implement a new method.

Original pull request: #272.
2018-02-16 18:31:43 +01:00
Fabian Henniges
30292101e4 DATACMNS-1255 - Allow configuration of QueryLookupStrategy for CDI repositories.
Original pull request: #272.
2018-02-16 18:31:08 +01:00
Oliver Gierke
63fec4a32b DATACMNS-1251 - Polishing.
Made methods static where possible.

Original pull request: #270.
2018-02-16 18:21:48 +01:00
Jens Schauder
139e098e85 DATACMNS-1251 - Added methods returning Instant to Revision.
Revision and RevisionMetadata now have methods returning Instant instead of LocalDateTime. The existing methods returning LocalDateTime are now deprecated.

Original pull request: #270.
2018-02-16 18:21:48 +01:00
Oliver Gierke
6675e33233 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:31:33 +01:00
Jens Schauder
9d3540cc54 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:31:33 +01:00
Jens Schauder
5251f72e69 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:31:33 +01:00
Christoph Strobl
4947ca01dc DATACMNS-1186 - After release cleanups. 2018-02-06 10:11:16 +01:00
Christoph Strobl
91611e3c36 DATACMNS-1186 - Prepare next development iteration. 2018-02-06 10:11:14 +01:00