Commit Graph

1628 Commits

Author SHA1 Message Date
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
Christoph Strobl
d3a388fb13 DATACMNS-1186 - Release version 2.1 M1 (Lovelace). 2018-02-06 09:47:10 +01:00
Christoph Strobl
046b1b2204 DATACMNS-1186 - Prepare 2.1 M1 (Lovelace). 2018-02-06 09:45:50 +01:00
Christoph Strobl
e63b1dfed4 DATACMNS-1186 - Updated changelog. 2018-02-06 09:45:36 +01:00
Oliver Gierke
d5f57f2e59 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:34 +01:00
Oliver Gierke
24a9493fa6 DATACMNS-1243 - Polishing.
Imports and author tags.

Original pull request: #268.
2018-02-01 10:55:34 +01:00
Jens Schauder
58b0cc9c0a 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:34 +01:00
Mark Paluch
af9b64ff00 DATACMNS-1220 - Updated changelog. 2018-01-24 13:41:20 +01:00
Mark Paluch
4d9329fab8 DATACMNS-1249 - Fix line endings to LF. 2018-01-24 12:32:29 +01:00
Mark Paluch
cc29d4c77c DATACMNS-1219 - Updated changelog. 2018-01-24 12:22:03 +01:00
Mark Paluch
7c61bdf2c8 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:38:29 +01:00
Oliver Gierke
c777363f3d 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:43 +01:00
Mark Paluch
06116b7726 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-01-12 12:28:38 +01:00
Oliver Gierke
5eb10a0817 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-01-12 11:04:49 +01:00
Mark Paluch
9e013d3c14 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-01-12 11:04:31 +01:00
Oliver Gierke
4a2df6299b DATACMNS-1241 - Improved Lazy.
Expanded generics to make sure we can take Functions and Suppliers of sub- and supertypes properly. Added factory method to create a Lazy from a fixed value. Added method to access Optional result. Added methods to allow chaining Lazy instances via ….or(…). Reduced visibility of ….orElseGet(…) as it basically equates to ….or(…).get(Optional)().

More unit tests.
2018-01-10 12:07:31 +01:00
Oliver Gierke
113181c44b DATACMNS-1242 - Reduced log output for test execution. 2018-01-10 12:07:31 +01:00
Oliver Gierke
dcb8166bbc DATACMNS-1235 - Polishing.
Introduced BeanLookup to easily create a Lazy<T>-based lookup of a unique bean by type on a ListableBeanFactory. This is in support of making it easy for downstream Spring Data modules to consume the EntityPathResolver declared in an ApplicationContext using XML configuration.

QuerydslWebConfiguration now uses a plain ObjectProvider to access the bean defined falling back to our default.

Original pull request: #265.
2018-01-10 12:07:31 +01:00
Oliver Gierke
408b9abd88 DATACMNS-1235 - Polishing.
Original pull request: #265.
2018-01-10 12:07:22 +01:00
Jens Schauder
9ae4216650 DATACMNS-1235 - Support for package suffix in SimpleEntityPathResolver.
SimpleEntityPathResolver is now a normal class and takes a package suffix in the constructor.

Original pull request: #265.
2018-01-10 12:07:07 +01:00
Mark Paluch
e30928dcf0 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:47 +01:00
Mark Paluch
51e7e1b7f5 DATACMNS-1240 - Update copyright years to 2018.
Also, remove some trailing whitespaces and align outdated license header format.
2018-01-08 16:04:34 +01:00
Oliver Gierke
eb2163a29e DATACMNS-563 - Polishing.
Removed obsolete generics. Rearranged some code for better readability.

Original pull request: #267.
2017-12-30 12:14:27 +01:00