Commit Graph

1691 Commits

Author SHA1 Message Date
Oliver Gierke
2cf0e6520f DATACMNS-1367 - Improved debug logging to better identify scanning and initialization of repositories.
Added debug logging in RepositoryFactorySupport and RepositoryConfigurationDelegate so that the scanning and the instantiation of repositories can be a lot easier identified in the logs.
2018-08-15 09:50:11 +02:00
Mark Paluch
b18e340b82 DATACMNS-1364 - Polishing.
Use weak references in annotation and property annotation cache to retain references until the last GC root is cleared. Remove trailing whitespaces. Reformat.

Original pull request: #304.
2018-08-15 09:50:10 +02:00
Mark Paluch
a85b4f3da9 DATACMNS-1364 - Store persistent properties in HashMap.
We now use HashMap to store persistent properties of a PersistentEntity. An entity is built in a single thread so no concurrent modification happens. Concurrent reads may happen during entity usage which is fine as the PersistentEntity is not changed anymore. Previously, we used ConcurrentReferenceHashMap defaulting to soft references. Soft references can be cleared at the discretion of the GC in response to memory demand. So a default ConcurrentReferenceHashMap is memory-sensitive and acts like a cache with memory-based eviction rules.

Persistent properties are not subject to be cached but elements of a PersistentEntity and cannot be recovered once cleared.

Original pull request: #304.
2018-08-15 09:47:39 +02:00
Oliver Gierke
b80f5c6714 DATACMNS-1369 - RepositoryFactoryBeanSupport now adds the aggregate root type to the MappingContext.
We now eagerly look up the aggregate root type of a repository in the MappingContext. Some implementations might not have pre-populated the context with all entities and we need to make sure it knows about the aggregate root as other clients (e.g. the auditing subsystem) might only defensively access the entities via PersistentEntities which is not adding new entities to avoid store clashes.
2018-08-09 15:34:34 +02:00
Oliver Gierke
33a138d30e DATACMNS-1370 - Avoid superflous, regex-based type check while scanning for custom implementations. 2018-08-09 13:09:44 +02:00
Oliver Gierke
7be149b2f5 DATACMNS-1359 - Improved exception message for missing accessors and getters.
The exception messages used in the PersistentProperty.getRequired(Getter|Setter|Field)(…) now mention the name of the property that's offending.
2018-08-06 12:41:45 +02:00
Mark Paluch
39e90ed3db DATACMNS-1362 - Fix broken links to Spring Framework Javadoc. 2018-08-06 08:57:11 +02:00
Mark Paluch
404f7a2994 DATACMNS-1339 - Updated changelog. 2018-07-27 11:45:22 +02:00
Mark Paluch
430428ca7f DATACMNS-1340 - After release cleanups. 2018-07-26 15:23:24 +02:00
Mark Paluch
967e4e4ac7 DATACMNS-1340 - Prepare next development iteration. 2018-07-26 15:23:22 +02:00
Mark Paluch
ccc0f9cba0 DATACMNS-1340 - Release version 2.0.9 (Kay SR9). 2018-07-26 14:44:00 +02:00
Mark Paluch
0417262bde DATACMNS-1340 - Prepare 2.0.9 (Kay SR9). 2018-07-26 14:43:06 +02:00
Mark Paluch
98ed8033ca DATACMNS-1340 - Updated changelog. 2018-07-26 14:42:51 +02:00
Mark Paluch
658b483aee DATACMNS-1321 - Updated changelog. 2018-07-26 14:03:17 +02:00
Mark Paluch
54b93f9e8c DATACMNS-1357 - Use shared DefaultConversionService in ProxyProjectionFactory and ResultProcessor.
ProxyProjectionFactory and ResultProcessor require a DefaultConversionService to convert values for projection proxies and to post-process query method results. Creating instances of these types requires an instance of the conversion service which previously created a DefaultConversionService instance (along all converter registrations) upon ProxyProjection/ResultProcessor instantiation.

We now use the shared instance that is initialized once and shared across all ProxyProjection/ResultProcessor instances to reduce garbage and improve the CPU profile.
2018-07-25 15:32:03 +02:00
Oliver Gierke
39303041ba DATACMNS-1345 - RepositoryFactoryBeanSupport now properly reports missing MappingContext. 2018-06-21 08:55:52 +02:00
Oliver Gierke
92dccd67a8 DATACMNS-1342 - TypeInformation.isCollectionLike() considers Streamable now. 2018-06-14 12:24:12 +02:00
Oliver Gierke
f7a0c22225 DATACMNS-1341 - ProxyUtils now detects JDK proxy target classes. 2018-06-14 11:50:58 +02:00
Mark Paluch
238aa9a28c DATACMNS-1313 - After release cleanups. 2018-06-13 21:24:35 +02:00
Mark Paluch
b9dc257387 DATACMNS-1313 - Prepare next development iteration. 2018-06-13 21:24:33 +02:00
Mark Paluch
dadff07680 DATACMNS-1313 - Release version 2.0.8 (Kay SR8). 2018-06-13 15:13:01 +02:00
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
1ac86fbdba DATACMNS-1288 - After release cleanups. 2018-05-08 15:04:28 +02:00
Mark Paluch
43f565d14c DATACMNS-1288 - Prepare next development iteration. 2018-05-08 15:04:26 +02:00
Mark Paluch
49a2a73722 DATACMNS-1288 - Release version 2.0.7 (Kay SR7). 2018-05-08 14:15:27 +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
71bdaf1b76 DATACMNS-1311 - Upgraded to XMLBeam 1.4.15.
Related tickets: DATACMNS-1292.
2018-05-08 10:25:06 +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