spring-data-commons icon indicating copy to clipboard operation
spring-data-commons copied to clipboard

Add flags to register pageable/sort resolvers on @EnableSpringDataWebSupport [DATACMNS-1494]

Open spring-projects-issues opened this issue 6 years ago • 3 comments

Tadaya Tsuyukubo opened DATACMNS-1494 and commented

I would like to have flags to control registering default pageable and sort resolvers on @EnableSpringDataWebSupport.

In my use case, I register a resolver for Pageable which collide with the default resolver registered by SpringDataWebConfiguration.

DATACMNS-822 introduced customizers but that still registers default resolvers.

In DATACMNS-1016, there is a comment saying extend the configuration class and "@Import" it instead of using _@EnableSpringDataWebSupport_. That for sure works, but requires an extended class and use "@Import" instead of "@Enabled..."

Since adding that control in @EnableSpringDataWebSupport is more intuitive from user perspective, I want "registerPageableResolver" and "registerSortResolver" flags to be added on @EnableSpringDataWebSupport.

PR will follow


No further details from DATACMNS-1494

spring-projects-issues avatar Mar 09 '19 00:03 spring-projects-issues

Tadaya Tsuyukubo commented

PR: https://github.com/spring-projects/spring-data-commons/pull/345

spring-projects-issues avatar Mar 09 '19 01:03 spring-projects-issues

Oliver Drotbohm commented

Rather than introducing a completely different mechanism to control a related aspect of the configuration, do you think we could refactor the customizers to allow controlling the creation of the resolvers as well?

spring-projects-issues avatar Mar 11 '19 08:03 spring-projects-issues

Tadaya Tsuyukubo commented

I think with customizer approach, there will be ordering issue.

For example, let's say customizer-A that creates Foo, and customizer-B that updates some property on Foo. If customizer-B applied first, then it will just skip since there is no Foo. Then, customizer-A will create a Foo. In this case, customizer-B gets ignored

spring-projects-issues avatar Mar 12 '19 22:03 spring-projects-issues