public class JacksonMappingAwareSortTranslator extends Object
Sort arguments that is aware of Jackson-Mapping on domain classes. Jackson field names are
translated to PersistentProperty names. Domain class is looked up by resolving request URLs to mapped
repositories. Sort translation is skipped if a domain class cannot be resolved.| Modifier and Type | Class and Description |
|---|---|
static class |
JacksonMappingAwareSortTranslator.SortTranslator
Translates
Sort orders from Jackson-mapped field names to PersistentProperty names. |
| Constructor and Description |
|---|
JacksonMappingAwareSortTranslator(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
org.springframework.data.repository.support.Repositories repositories,
DomainClassResolver domainClassResolver,
org.springframework.data.mapping.context.PersistentEntities persistentEntities,
Associations associations)
Creates a new
JacksonMappingAwareSortTranslator for the given ObjectMapper, Repositories,
DomainClassResolver and PersistentEntities. |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.data.domain.Sort |
translateSort(org.springframework.data.domain.Sort input,
MethodParameter parameter,
NativeWebRequest webRequest)
Translates Jackson field names within a
Sort to PersistentProperty property names. |
public JacksonMappingAwareSortTranslator(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
org.springframework.data.repository.support.Repositories repositories,
DomainClassResolver domainClassResolver,
org.springframework.data.mapping.context.PersistentEntities persistentEntities,
Associations associations)
JacksonMappingAwareSortTranslator for the given ObjectMapper, Repositories,
DomainClassResolver and PersistentEntities.objectMapper - must not be null.repositories - must not be null.domainClassResolver - must not be null.persistentEntities - must not be null.associations - must not be null.protected org.springframework.data.domain.Sort translateSort(org.springframework.data.domain.Sort input,
MethodParameter parameter,
NativeWebRequest webRequest)
Sort to PersistentProperty property names.input - must not be null.parameter - must not be null.webRequest - must not be null.Sort containing translated property names or null the resulting Sort contains
no properties.Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.