DATAREST-1280 Add support sort collection resource by associated property. #2328
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1641
Related tickets #1386 #1343
I delete those code and execute sort 4 patterns.
spring-data-rest/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/JacksonMappingAwareSortTranslator.java
Lines 195 to 197 in f0e86b9
Currently, it seems to support linkable associations.
Therefore, I have removed the check process for linkable associations.
Are there any other patterns that should be tested further?
Patterns result:
eager and exported
Path:
/accounts_eager_and_exported?sort=accountType.typeName,desc
Query:
Entity: AccountEagerAndExported.java
Repository: AccountEagerAndExportedRepository.java
eager and no exported
Path:
/accounts_eager_and_no_exported?sort=accountType.typeName,desc
Query:
Entity: AccountEagerAndNoExported.java
Repository: AccountEagerAndNoExportedRepository.java
lazy and exported
Path:
accounts_lazy_and_exported?sort=accountType.typeName,desc
Query:
Entity: AccountLazyAndExported.java
Repository: AccountLazyAndExportedRepository.java
lazy and no exported
In the first place, it is not supported by Spring Data REST.
Example code repository: https://github.com/mikoto2000/spring-data-rest-example