DATAREST-1280 Add support sort collection resource by associated property.#2328
Open
mikoto2000 wants to merge 1 commit intospring-projects:mainfrom
Open
DATAREST-1280 Add support sort collection resource by associated property.#2328mikoto2000 wants to merge 1 commit intospring-projects:mainfrom
mikoto2000 wants to merge 1 commit intospring-projects:mainfrom
Conversation
Author
|
@mp911de |
Contributor
|
Any news on this? We'd really like to be able to sort by fields in linked associations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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,descQuery:
Entity: AccountEagerAndExported.java
Repository: AccountEagerAndExportedRepository.java
eager and no exported
Path:
/accounts_eager_and_no_exported?sort=accountType.typeName,descQuery:
Entity: AccountEagerAndNoExported.java
Repository: AccountEagerAndNoExportedRepository.java
lazy and exported
Path:
accounts_lazy_and_exported?sort=accountType.typeName,descQuery:
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