Commit Graph

158 Commits

Author SHA1 Message Date
sokomishalov
f91901387f Accept JsonProvider upon JsonProjectingMethodInterceptorFactory creation.
We now configure explicitly the JsonProvider that is used by JSONPath through JsonProjectingMethodInterceptorFactory to avoid misconfiguration due to JSONPath defaulting attempts. Accepting JsonProvider allows for improved flexibility during configuration.

Closes #2403
2021-07-13 14:11:48 +02:00
Stephane Nicoll
8262e21c1a Polishing.
A public bean method that returns a private type is unusual and prevents the processing of such bean in reflection-free use cases. There was also an unnecessary qualifier in the implementation.

Closes #2399
2021-07-12 15:18:35 +02:00
Mark Paluch
394187a03b Revise QuerydslPredicateBuilder nullability behavior.
We now no longer return a null Predicate from QuerydslPredicateBuilder.getPredicate(…) if the input values are empty or if the constraints are empty. Instead, we return an empty BooleanBuilder instance to avoid null handling on the calling side.

HandlerMethodArgumentsResolvers for QuerydslBindings retain their null/Optional.empty semantics.

Closes #2396
2021-06-29 10:12:34 +02:00
Mark Paluch
c24ba262ca Polishing.
Use Spring's nullability annotations where used as part of API nullability indicators.

See #2385
2021-06-17 09:03:00 +02:00
Oliver Drotbohm
1e13d40cbb Avoid pre-computing base URI in PagedResourceAssemblerArgumentResolver.
We now avoid the pre-computation of the base URI in PagedResourceAssemblerArgumentResolver as the actual assembler will fall back to using the URI of the current request by default anyway. The latter makes sure that request parameters, that are contained in the original requests appear in links created. If a controller wants to deviate from that behavior, they can create a dedicated link themselves and hand that to the assembler explicitly.

Fixes GH-2173, GH-452.
2021-01-26 10:00:52 +01:00
Mark Paluch
89c5b3839c Enable QuerydslPredicate for meta-annotation usage.
We now support composed annotations that are meta-annotated with QuerydslPredicate.

Resolves #2277.
2021-01-25 16:20:55 +01:00
Mark Paluch
d57fb3ea0e DATACMNS-1785 - Polishing.
Introduce constructors accepting non-null ConversionService, handle conversion service defaulting in configuration classes by using ObjectProvider. Extract common code to create a predicate in getPredicate(…) method. Add unit test.

Convert spaces to tabs.

Related ticket: #2200.
Original pull request: #2274.
2021-01-25 15:52:50 +01:00
Matías Hermosilla
a83969005b DATACMNS-1785 - Add ReactiveQuerydslPredicateArgumentResolver and ReactiveQuerydslWebConfiguration.
We now provide ReactiveQuerydslPredicateArgumentResolver to resolve Querydsl Predicates when using Spring WebFlux.

Related ticket: #2200.
Original pull request: #2274.
2021-01-25 15:52:30 +01:00
Mark Paluch
efe93e31b1 Polishing.
Reuse definitive path flag without recompile the expression.

See #2270
2021-01-12 15:50:51 +01:00
Mark Paluch
037df8e3ae Correctly unwrap nested JSON array projections.
We now check for double-nesting of JSON path evaluation results when the return type is a collection. If the result is double-wrapped and the nested object is a collection then we unwrap it.

Closes #2270
2021-01-12 15:50:50 +01:00
Mark Paluch
8bd2f9bf34 Update copyright year to 2021.
Closes #2268.
2021-01-07 13:42:27 +01:00
Mark Paluch
6616f6e577 DATACMNS-1827 - Polishing.
Extract qualifier lookup into SpringDataAnnotationUtils.

Original pull request: #474.
2020-12-01 10:15:15 +01:00
Vedran Pavic
438b01e161 DATACMNS-1827 - Consider Qualifier meta-annotated Sort method parameters.
Original pull request: #474.
2020-12-01 10:15:08 +01:00
Mark Paluch
cd482bf9e3 DATACMNS-1827 - Polishing.
Consider Qualifier meta-annotated Sort and Pageable method parameters. Add author tag.

Original pull request: #473.
2020-11-11 09:30:06 +01:00
Vedran Pavic
e758dd3a84 DATACMNS-1827 - Pageable and Sort arguments with empty qualifier value shouldn't be prefixed with delimiter.
Original pull request: #473.
2020-11-11 09:30:01 +01:00
Oliver Drotbohm
af9dd6110d DATACMNS-1726 - Polishing of nullability after Lombok removal.
Reviewed visibility modifiers manually introduced constructors previously provided by Lombok. Also some nullability constraints have been accidentally changed by that.
2020-09-25 15:29:08 +02:00
Christoph Strobl
f261220372 DATACMNS-1762 - Polishing.
Update JavaDoc, remove unused imports and reduce method visibility.

Original Pull Request: #459
2020-09-25 08:00:29 +02:00
Oliver Drotbohm
96097c290d DATACMNS-1736 - Polishing.
Avoid reuse of Lazy instances for (Sort|Pageable)HandlerMethodArgumentResolver and consistently use those to avoid breaking API changes in configuration classes.
2020-09-15 17:01:20 +02:00
Greg L. Turnquist
9d12ac7324 DATACMNS-1736 - Switch away from overrideable methods. 2020-09-15 17:01:19 +02:00
Mark Paluch
c10072c96f DATACMNS-1736 - Use BeanFactory lookup in configuration classes instead of intercepted local bean methods.
We now use @Configuration(proxyBeanMethods = false) and use BeanFactory bean lookups to avoid CGlib proxy creation.

Using Spring's BeanProvider.getIfUnique(…) instead of catching NoSuchBeanDefinitionException.
2020-09-15 17:01:19 +02:00
Phillip Webb
67442077b7 DATACMNS-1755 - Consistently use commons-logging.
Replace the few occurrences where SLF4J was being used directly so that
all logging now happens via commons-logging. The log patterns used in
SLF4J messages have been replaced with `LogMessage` which was introduced
in Spring Framework 5.2.

Original pull request: #448.
2020-06-25 11:20:24 +02:00
Phillip Webb
b42cdb6568 DATACMNS-1755 - Use method references in favor of lambdas.
Simplify several lambda expressions in the codebase by using
method references.

Original pull request: #448.
2020-06-25 11:19:52 +02:00
Phillip Webb
ea263b233b Rename uppercase 'LOGGER' static finals
Rename static final `LOGGER` members to use the lowercase form.
Although the loggers are static final, they are not constant values.
2020-06-25 11:09:16 +02:00
Mark Paluch
4be5aae181 DATACMNS-1726 - Delombok source files. 2020-05-15 08:46:58 +02:00
Oliver Drotbohm
0d4b764c2c DATACMNS-1722 - More defensive lookup of XmlBeamHttpMessageConverter.
We now avoid a type reference to XmlBeamHttpMessageConverter in a field within SpringDataWebConfiguration to avoid a type reference to a potentially unresolvable type. This seems to have caused issues on certain JDK 14 builds [0].

[0] https://github.com/spring-projects/spring-framework/issues/25050
2020-05-12 09:03:17 +02:00
Mark Paluch
54d9f01619 DATACMNS-658 - Polishing.
Introduce caseSensitive() flag to `@SortDefault`. Move sort spec parsing into parser class. Update documentation.

Original pull request: #172.
2020-03-11 10:18:54 +01:00
Dan Nawrocki
9ef3099711 DATACMNS-658 - Add IgnoreCase ordering option to SortHandlerMethodArgumentResolver.
We now pick up case-insensitive sorting flags by parsing it up from a sort query string argument.

To enable ignore case for one or more properties, we expect "ignorecase" as last element in a sort spec. Sort order and case-sensitivity options are parsed case-insensitive for a greater flexibility:

http://localhost/?sort=firstname,IgnoreCase or http://localhost/?sort=firstname,ASC,ignorecase

Original pull request: #172.
2020-03-11 10:15:29 +01:00
Oliver Drotbohm
1406af8f71 DATACMNS-1647 - Switched to use factory methods of RepresentationModel types. 2020-01-14 14:49:45 +01:00
Mark Paluch
eed7658ce5 DATACMNS-1643 - Update copyright years to 2020. 2020-01-07 08:32:25 +01:00
Oliver Drotbohm
664e661783 DATACMNS-1593, DATACMNS-1635 - Overhauled null handling in QuerydslPredicateArgumentResolver.
QuerydslPredicateArgumentResolver now properly handles predicate lookups that result in null values. The semantics of a handler method parameter of type of Querydsl's Predicate have been tightened to always see a non-null Predicate by default. Users that want to handle the absence of predicates explicitly can opt into seeing null by annotating the parameter with @Nullable or use Optional<Predicate>.

QuerydslPredicateBuilder now consistently returns null in case the original parameter map is entirely empty or consists of only keys with empty value arrays as empty form submissions do. This partially reverts the work of DATACMNS-1168, which moved into the direction of returning a default Predicate value for empty maps in the first place. That however prevents us from producing empty Optionals.

Related tickets: DATACMNS-1168.
2019-12-10 14:52:06 +01:00
Mark Paluch
e3d6c31929 DATACMNS-1603 - Improve log message wording. 2019-11-26 13:35:41 +01:00
Mark Paluch
dbc6810fc3 DATACMNS-1211 - Add ReactivePageableHandlerMethodArgumentResolver.
Add ReactivePageableHandlerMethodArgumentResolver and extract shared code from imperative PageableHandlerMethodArgumentResolver into PageableHandlerMethodArgumentResolverSupport.

Original pull request: #264.
2019-09-26 16:43:58 +02:00
Mark Paluch
48daa4c4b1 DATACMNS-1211 - Add ReactiveSortHandlerMethodArgumentResolver.
Add ReactiveSortHandlerMethodArgumentResolver and extract shared code from imperative SortHandlerMethodArgumentResolver into SortHandlerMethodArgumentResolverSupport.

Original pull request: #264.
2019-09-26 16:43:50 +02:00
Mark Paluch
78dcab59c7 DATACMNS-1486 - Polishing.
Consistently annotate all nullable method arguments with Nullable.

Original pull request: #341.
2019-09-18 15:34:47 +02:00
Henning Hoefer
6699e9692f DATACMNS-1486 - Add missing Nullable annotation in HateoasSortHandlerMethodArgumentResolver.
Original pull request: #341.
2019-09-18 15:33:39 +02:00
Oliver Drotbohm
ed0d30b4d6 DATACMNS-1551 - Polishing.
Method order in SortHandlerMethodArgumentResolver.
2019-07-01 14:30:48 +02:00
Oliver Drotbohm
4c1aed27d6 DATACMNS-1551 - SortHandlerMethodArgumentResolver now drops dot-only property segments.
If plain dots were submitted as elements in a Sort expression to be parsed by SortHandlerMethodArgumentResolver, those dots would be considered a property of the sort expression, which is of course wrong. We now drop property candidates solely consisting of dots and whitespace.
2019-07-01 14:16:09 +02:00
Oliver Drotbohm
e31c7aed51 DATACMNS-1526 - Adapt to API changes in Spring HATEOAS. 2019-05-08 19:10:04 +02:00
Jerzy Kwiatkowski
2b6682d3b1 DATACMNS-1520 - Fix typo in Javadoc.
Original pull request: #393.
2019-04-23 17:11:18 +02:00
Spring Operator
48c9297118 DATACMNS-1500 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 701 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original Pull Request: #387
2019-03-22 11:00:44 +01:00
Spring Operator
38c2ec0ae3 DATACMNS-1500 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* [ ] http://help.eclipse.org/oxygen/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/task-using_external_null_annotations.htm (200) with 1 occurrences could not be migrated:
   ([https](https://help.eclipse.org/oxygen/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/task-using_external_null_annotations.htm) result SSLException).
* [ ] http://www.querydsl.com (200) with 2 occurrences could not be migrated:
   ([https](https://www.querydsl.com) result AnnotatedConnectException).
* [ ] http://www.querydsl.com/ (200) with 2 occurrences could not be migrated:
   ([https](https://www.querydsl.com/) result AnnotatedConnectException).
* [ ] http://xml.org/sax/features/external-general-entities (301) with 1 occurrences could not be migrated:
   ([https](https://xml.org/sax/features/external-general-entities) result SSLHandshakeException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://www.w3.org/2001/03/xml.xsd (ReadTimeoutException) with 1 occurrences migrated to:
  https://www.w3.org/2001/03/xml.xsd ([https](https://www.w3.org/2001/03/xml.xsd) result SSLException).
* [ ] http://www.w3.org/XML/1998/namespace (ReadTimeoutException) with 1 occurrences migrated to:
  https://www.w3.org/XML/1998/namespace ([https](https://www.w3.org/XML/1998/namespace) result SSLException).
* [ ] http://foo:9090 (UnknownHostException) with 2 occurrences migrated to:
  https://foo:9090 ([https](https://foo:9090) result UnknownHostException).
* [ ] http://http://www.querydsl.com (UnknownHostException) with 1 occurrences migrated to:
  https://http://www.querydsl.com ([https](https://https://www.querydsl.com) result UnknownHostException).
* [ ] http://apache.org/xml/features/disallow-doctype-decl (404) with 1 occurrences migrated to:
  https://apache.org/xml/features/disallow-doctype-decl ([https](https://apache.org/xml/features/disallow-doctype-decl) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html with 1 occurrences migrated to:
  https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html ([https](https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html) result 200).
* [ ] http://docs.spring.io/spring/docs/ with 1 occurrences migrated to:
  https://docs.spring.io/spring/docs/ ([https](https://docs.spring.io/spring/docs/) result 200).
* [ ] http://github.com/spring-projects/spring-data-commons with 1 occurrences migrated to:
  https://github.com/spring-projects/spring-data-commons ([https](https://github.com/spring-projects/spring-data-commons) result 200).
* [ ] http://goessner.net/articles/JsonPath/ with 1 occurrences migrated to:
  https://goessner.net/articles/JsonPath/ ([https](https://goessner.net/articles/JsonPath/) result 200).
* [ ] http://projects.spring.io/spring-data/ with 2 occurrences migrated to:
  https://projects.spring.io/spring-data/ ([https](https://projects.spring.io/spring-data/) result 200).
* [ ] http://stackoverflow.com/questions/tagged/spring-data with 2 occurrences migrated to:
  https://stackoverflow.com/questions/tagged/spring-data ([https](https://stackoverflow.com/questions/tagged/spring-data) result 200).
* [ ] http://www.regular-expressions.info/unicode.html with 2 occurrences migrated to:
  https://www.regular-expressions.info/unicode.html ([https](https://www.regular-expressions.info/unicode.html) result 200).
* [ ] http://www.springframework.org/schema/beans/spring-beans.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* [ ] http://www.springframework.org/schema/context/spring-context.xsd with 8 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context.xsd ([https](https://www.springframework.org/schema/context/spring-context.xsd) result 200).
* [ ] http://www.springframework.org/schema/data/repository/spring-repository.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/repository/spring-repository.xsd ([https](https://www.springframework.org/schema/data/repository/spring-repository.xsd) result 200).
* [ ] http://www.vavr.io/ with 2 occurrences migrated to:
  https://www.vavr.io/ ([https](https://www.vavr.io/) result 200).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://docs.spring.io/spring-data/data-commons/docs/current/reference/html/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-data/data-commons/docs/current/reference/html/ ([https](https://docs.spring.io/spring-data/data-commons/docs/current/reference/html/) result 301).
* [ ] http://help.github.com/forking/ with 1 occurrences migrated to:
  https://help.github.com/forking/ ([https](https://help.github.com/forking/) result 301).
* [ ] http://projects.spring.io/spring-data with 1 occurrences migrated to:
  https://projects.spring.io/spring-data ([https](https://projects.spring.io/spring-data) result 301).
* [ ] http://www.atomenabled.org/developers/syndication/atom-format-spec.php with 1 occurrences migrated to:
  https://www.atomenabled.org/developers/syndication/atom-format-spec.php ([https](https://www.atomenabled.org/developers/syndication/atom-format-spec.php) result 301).
* [ ] http://www.springframework.org/schema/data/jpa/spring-jpa.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/jpa/spring-jpa.xsd ([https](https://www.springframework.org/schema/data/jpa/spring-jpa.xsd) result 301).
* [ ] http://www.springframework.org/schema/oxm/spring-oxm.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/oxm/spring-oxm.xsd ([https](https://www.springframework.org/schema/oxm/spring-oxm.xsd) result 301).
* [ ] http://www.threeten.org/threetenbp with 2 occurrences migrated to:
  https://www.threeten.org/threetenbp ([https](https://www.threeten.org/threetenbp) result 301).
* [ ] http://www.xmlbeam.org with 2 occurrences migrated to:
  https://www.xmlbeam.org ([https](https://www.xmlbeam.org) result 301).
* [ ] http://www.springsource.org/download with 1 occurrences migrated to:
  https://www.springsource.org/download ([https](https://www.springsource.org/download) result 302).

# Ignored
These URLs were intentionally ignored.

* http://localhost:8080/persons with 1 occurrences
* http://localhost:8080/persons?page=1&size=20 with 1 occurrences
* http://localhost:8080?page=0&size=10 with 1 occurrences
* http://www.springframework.org/schema/beans with 8 occurrences
* http://www.springframework.org/schema/context with 16 occurrences
* http://www.springframework.org/schema/data/jaxb with 3 occurrences
* http://www.springframework.org/schema/data/jpa with 4 occurrences
* http://www.springframework.org/schema/data/repository with 20 occurrences
* http://www.springframework.org/schema/oxm with 2 occurrences
* http://www.springframework.org/schema/tool with 16 occurrences
* http://www.w3.org/1999/xhtml with 1 occurrences
* http://www.w3.org/2001/XMLSchema with 10 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 4 occurrences
* http://www.w3.org/2005/Atom with 4 occurrences

Original Pull Request: #367
2019-03-21 08:26:30 +01:00
Oliver Drotbohm
0bf160eb97 DATACMNS-1496 - Removed deprecations at least introduced in Lovelace. 2019-03-13 18:29:08 +01:00
Oliver Drotbohm
435aaaaa35 DATACMNS-1470 - Adapt to package refactorings in Spring HATEOAS. 2019-02-28 08:00:11 +01:00
Oliver Drotbohm
092e23b08c DATACMNS-1470 - Further adaption of Spring HATEOAS 1.0 API changes. 2019-02-15 11:07:10 +01:00
Greg Turnquist
8c076f921d DATACMNS-1470 - Upgrade to Spring HATEOAS 1.0 API 2019-02-02 00:09:48 +01:00
Mark Paluch
1969f4bcdc DATACMNS-1459 - Update copyright years to 2019. 2019-01-02 12:12:19 +01:00
Oliver Drotbohm
566e6a3258 DATACMNS-1455 - HateoasPageableHandlerMethodArgumentResolver handles Pageable.unpaged() coprrectly.
Pageable.unpaged() is now effectively handled like a null value given in the 1.x branch.
2018-12-21 09:55:11 +01:00
Oliver Gierke
8b6cc3af11 DATACMNS-1386 - Avoid strong type dependency to Jackson in SpringDataWebConfiguration.
We now avoid using a Lambda to provide a default ObjectMapper instance in the code that's reflectively guarded against Jackson not being present. The lambda causes a method to be generated for the class that will require ObjectMapper to be present on reflection inspection of that method. Switching to a method reference to ObjectMapper's constructor resolves that problem as the indirection via the additional, offending method is not needed.

Further reading: https://www.javabullets.com/how-lambdas-and-anonymous-inner-classesaic-work/
2018-09-07 12:09:29 +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
Robert Winkler
6275ded50f DATACMNS-1293 - Fixed Querydsl package reference in QuerydslPredicateArgumentResolver Javadoc.
Original pull request: #284.
2018-04-12 14:33:15 +02:00