205 Commits

Author SHA1 Message Date
Mark Paluch
fbea79c1db Polishing.
Fix missing Javadoc references.

See #2454
2025-05-16 12:34:46 +02:00
Oliver Drotbohm
ca5f6a73e7 Produce IANA registered flavor of HAL media type by default.
Fixes GH-2454.
2025-05-16 12:34:46 +02:00
Mark Paluch
8cb01b103c Adopt to deprecation removals in Commons.
Closes #2437
2025-05-16 12:34:45 +02:00
Mark Paluch
b1d0cb8e19 Polishing.
Add test.

See: #2477
Original pull request: #2478
2025-05-13 11:51:41 +02:00
Andrey Litvitski
b0c05e7d70 Fix integer overflow in @Order of RepositoryRelProvider.
Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>

Closes: #2477
Original pull request: #2478
2025-05-13 11:51:31 +02:00
Mark Paluch
a96862bb91 Extend license header copyright years to 2025.
See #2448
2025-01-08 10:04:48 +01:00
Oliver Drotbohm
836e9ba456 Javadoc polishing.
Related ticket: GH-2252.
2024-03-14 10:47:36 +01:00
Oliver Drotbohm
11d55d8ee5 Polishing.
Related ticket: GH-2252.
2024-03-14 10:36:58 +01:00
Florian Cramer
bf17f39111 Support validation for fields that are not a PersistentEntity.
For entity types that use transient fields, the validation integration needs to treat those as normal bean types an must not reject the values right away.

Fixes GH-2252.
2024-03-14 10:36:57 +01:00
Mark Paluch
ae851d878f Extend license header copyright years to 2024.
See #2349
2024-01-02 14:42:06 +01:00
Oliver Drotbohm
30fdbd4949 Fix potential NullPointerException in ProjectionSerializer.
Fixes GH-1947.
2023-12-15 12:21:52 +01:00
Mark Paluch
aa7262b038 Delombok code.
Closes #2286
2023-07-07 14:51:03 +02:00
Mark Paluch
b084f67189 Polishing.
Fix invalid Javadoc references.

See #2239
2023-03-20 08:21:12 +01:00
Oliver Drotbohm
e4bca534bf Support to receive aggregate references as request parameters.
We now support using AggregateReference as type to bind request parameters taking URIs pointing to related aggregates. The default resolution will try to resolve the entire URI via UriToEntityConverter but one can also provide a function that can extract any part of the URI to be then resolved into either an identifier, aggregate instance or jMolecules Association against the ConversionService.

Fixes #2239.
2023-03-19 23:56:39 +01:00
Oliver Drotbohm
7c9a5275a3 Polish Javadoc. 2023-02-21 19:01:55 +01:00
Oliver Drotbohm
d02d1bb0c1 Support for returning response bodies on deletion of item resources.
RepositoryRestConfiguration now allows to configure to return a response body for the deletion of item resources. The controller implementation follows the same patter we have already established for creation and updates: unless explicitly enabled or disabled we now consider the presence of an accept header as indicator of whether a response body should be rendered.

This could be a "breaking" change for clients having explicitly expected 204 until now even for requests with an Accept header. If that's an issue, those should either explicitly disable the setting, do not submit an Accept header or loosen their expectations to expect either 200 or 2xx as indicator of success in general.

Fixes #2225.
2023-02-21 17:25:28 +01:00
Mark Paluch
f0e86b9a17 Extend license header copyright years to 2023.
See #2211
2023-01-02 09:53:37 +01:00
Christoph Strobl
6f68fe814f Add Nullable annotation to parameter of overridden equals method.
Closes: #2196
Original pull request: #2197
2022-12-02 11:16:15 +01:00
John Blum
29b7305d71 Remove punctuation in Exception messages.
Closes #2152.
2022-06-08 16:08:03 -07:00
Mark Paluch
218bedff06 Adopt tests to PagingAndSortingRepository split.
Closes #2105
2022-02-11 11:49:41 +01:00
Oliver Drotbohm
b7d6b2b78c Update copyright years to 2022. 2022-02-07 10:26:46 +01:00
Jens Schauder
ee317f1b91 Remove Eclipse Non-Javadoc comments.
Closes #2093
2022-01-05 13:40:05 +01:00
Oliver Drotbohm
1828a6a2a7 Switch to JUnit 5.
Issue #2075.
2021-10-12 22:29:45 +02:00
Oliver Drotbohm
c0125c99a8 Qualify references to ResourceType.COLLECTION to avoid ambiguities to AssertJ in tests.
Fixes #2071.
2021-10-06 12:35:09 +02:00
Oliver Drotbohm
c6b77e3dd9 Polish Javadoc to prepare builds with JDK 17.
Issue #2068.
2021-09-21 16:36:26 +02:00
Oliver Drotbohm
b678ce6bc9 PersistentEntitiesResourceMapping.hasMappingFor(…) should lookup metadata on cache miss. 2021-07-13 09:27:03 +02:00
Oliver Drotbohm
940a676e6d RepositoryResourceMappings now processes all entities to detect repository mappings.
We now consider all registered PersistentEntity instances and try to detect repository metadata for them. A case we didn't cover before was that a repository was declared for an aggregate super type but the actual child aggregate class didn't have a dedicated repository declared. While this is a perfectly valid scenario, the mapping information was broken as it fell back on the plain domain type information and produced paths and relation names derived from that, even if there's a super type repository available.

Thus, solely traversing the aggregate types we have repositories registered for is not enough. We now traverse all known PersistentEntity types and also register repository metadata for all types that are assignable to a known domain type. The latter is actually implemented in Spring Data Commons' Repositories via spring-projects/spring-data-commons#2406.
2021-07-07 16:20:09 +02:00
Oliver Drotbohm
21ed68262f Properly handle associations in nested entities.
Nested entities that contain a reference to an aggregate root get a link to that attached to their representation. Previously, the creation of those links assumed that the reference is a materialized instance of the remote aggregate. That's now altered to be able to deal with associations, use identifiers directly or materialize to an intermediate aggregate instance to potentially use a custom lookup.
2021-04-07 20:07:53 +02:00
Oliver Drotbohm
20cb33512e Fixed potential NullPointerException in PersistentPropertyResourceMapping.isExported().
Fixes GH-1994.
2021-04-07 20:07:53 +02:00
Oliver Drotbohm
cb75eaee90 #1974 - Polishing.
Deprecated configuration methods on RepositoryRestConfiguration for better naming.
2021-02-18 14:04:34 +01:00
Oliver Drotbohm
517bb5f202 #1974 - Improve default LinkRelationProvider setup to also consider @Relation.
RepositoryRestConfiguration now defaults the LinkRelationProvider instance to a delegating one considering both AnnotationLinkRelationProvider and EvoLinkRelationProvider so that @Relation annotations on entity types.
2021-02-18 14:04:34 +01:00
Mark Paluch
7afe7f1a9c Update copyright year to 2021.
Closes #1952
2021-01-12 11:45:16 +01:00
Oliver Drotbohm
328ea26244 DATAREST-1542 - Remove dependency to Spring WebMVC from core module.
Finally remove the dependency to Spring WebMVC from Spring Data REST's core module. Removed previously deprecated methods and update test configuration applying customizations.

Related tickets: DATAREST-1543.
2020-11-30 13:55:52 +01:00
Greg L. Turnquist
9737366174 DATAREST-1545 - Migrate away from proxy-based configuration. 2020-09-15 17:13:53 +02:00
Oliver Drotbohm
bf401f7476 DATAREST-1553 - Removed deprecations introduced prior to 3.4.
Removed Java8PluginRegistry not in use anymore anyway. Same for RepositoryRestConfigurerAdapter. Deprecated legacy ResourceMappingUtils and its client code exposed in RepositoryRestConfiguration as it's also not considered anymore.
2020-08-11 17:44:36 +02:00
Oliver Drotbohm
b17fed5fa6 DATAREST-1523 - Delombok production sources.
Hacking.
2020-08-11 16:53:15 +02:00
Mark Paluch
69c3491861 DATAREST-1549 - Adopt to changed MappingException thrown by PersistentEntities. 2020-08-04 15:30:37 +02:00
Oliver Drotbohm
9f62237dd3 DATAREST-1543 - Deprecate RepositoryRestConfiguration.getCorsRegistry().
Slightly tweaked the configuration model to rather handle the CorsRegistry via RepositoryRestConfigurer.configureRepositoryRestConfiguration(…) rather than RepositoryRestConfiguration itself. That allows moving of Spring WebMVC as a dependency in the core module.

The original methods exposing access to the CorsRegistry are now still available in deprecated form to not break existing clients.

Follow-up ticket: DATAREST-1542.
2020-07-03 15:06:41 +02:00
Oliver Drotbohm
d7f36b1180 DATAREST-1540 - Improvements in HandlerMapping implementation for Spring 5.3.
We now use Spring's path prefix capabilities to apply Spring Data REST's base path to its mappings. This was previously implemented by tweaking the matching conditions.

We now also pick up Spring 5.3's PathPatternParser and apply that to the custom HandlerMapping implementations we register.

Moved DelegatingHandlerMapping into the configuration package to be able to keep it around in package scope.

Deprecated RepositoryRestConfiguration.getBaseUri() as we have only supported paths for quite a while now. Moved all client code to ….getBasePath() instead.
2020-07-01 18:55:11 +02:00
Mark Paluch
c485d612a7 DATAREST-1502 - Polishing.
Use diamond syntax where possible. Fix Javadoc.
2020-04-02 15:31:07 +02:00
Mark Paluch
34ab20e8d7 DATAREST-1502 - Use ConcurrentHashMap in PersistentEntitiesResourceMappings instead of ConcurrentReferenceHashMap.
We use now consistently ConcurrentHashMap instead of ConcurrentReferenceHashMap to avoid object eviction by GC runs as some caches are accessed in a way that does not allow for lazy recomputation of values.
2020-04-02 15:29:43 +02:00
Oliver Drotbohm
4c17d54e9a DATAREST-1499, DATAREST-1500 - Cleanups.
Moved off Spring Framework deprecations for HttpMessageNotReadableException. This required some rearrangements of method signatures for types (hopefully) exclusively used by internal abstractions (some public, but not very friendly for user extension in the first place).

Switched to consistent use of Pageable.unpaged() instead of null. Switched to the use of new factory methods in Spring HATEOAS. Some Java 8 based improvements in request handling to simplify the implementation code. Deprecation of code that got obsolete due to the use of the factory methods.

Moved off some deprecations in Jackson APIs.

Removed a couple of unused imports. General avoidance of common warnings. Suppression where needed. Removed dead code in configuration.
2020-03-27 14:16:47 +01:00
Oliver Drotbohm
b74089cc3b DATAREST-1489 - Fixed caches in PersistentEntitiesResourceMappings.
We now consistently use ConcurrentReferenceHashMap for all caches to make PersistentEntitiesResourceMappings thread-safe.
2020-03-12 14:33:30 +01:00
Oliver Drotbohm
ac95b17acd DATAREST-582 - Add unit test to makes sure method is invoked on proxy.
See this Twitter thread for details: https://twitter.com/PreAuthorize/status/1227865219264741376
2020-02-13 17:13:35 +01:00
Oliver Drotbohm
d8c3394cd7 DATAREST-1470 - Switched to use factory methods of RepresentationModel types. 2020-01-14 14:51:18 +01:00
Mark Paluch
88f49da22f DATAREST-1467 - Update copyright years to 2020. 2020-01-07 09:02:59 +01:00
Oliver Drotbohm
205e487317 DATAREST-1460 - PersistentEntityResourceMappings now uses thread-safe caches. 2019-12-09 18:04:50 +01:00
Mark Paluch
19c261d7d0 DATAREST-1410 - Migrate remaining tests to AssertJ. 2019-07-31 10:06:03 +02:00
Oliver Drotbohm
4a48be3ff7 DATAREST-1404 - TypeBasedCollectionResourceMapping now avoids repeated annotation lookups.
We're now making use of Lazy to avoid recomputation of annotation based functionality.
2019-06-26 17:46:43 +02:00
Oliver Drotbohm
556e918ef7 DATAREST-1403 - CollectionResourceMapping.getExcerptProjection() now returns Optional. 2019-06-26 17:46:43 +02:00