Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DATACMNS-918, DATAREST-910 - Support nested Sort properties. #232

Closed
wants to merge 3 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Sep 28, 2016

We now support nested Sort properties considering Jackson mapping. Sort translation is optional and skipped if the domain class is not resolvable. Translation in the scope of a domain class maps property paths to apply sorting using nested properties.

We also use SortArgumentResolver and PageableArgumentResolver to resolve and post-process Sort and Pageable arguments.

A sort string nested-name resolves to a property path anotherWrap.embedded.name.

class Aggregate {

    @JsonUnwrapped
    public UnwrapEmbedded anotherWrap;
}

class UnwrapEmbedded {

    @JsonUnwrapped(prefix = "nested-")
    public Embedded embedded;
}

class Embedded {
    public String name;
}

Related ticket: DATAREST-910
Depends on: spring-projects/spring-data-commons#179

We now support nested Sort properties considering Jackson mapping. Sort translation is optional and skipped if the domain class is not resolvable. Translation in the scope of a domain class maps property paths to apply sorting using embedded properties.

A sort string `nested-name` resolves to a property path `anotherWrap.embedded.name`.

class Aggregate {

	@JsonUnwrapped
	public UnwrapEmbedded anotherWrap;
}

class UnwrapEmbedded {

	@JsonUnwrapped(prefix = "nested-")
	public Embedded embedded;
}

class Embedded {
	public String name;
}
odrotbohm pushed a commit that referenced this pull request Dec 6, 2016
odrotbohm pushed a commit that referenced this pull request Dec 6, 2016
We now support nested Sort properties considering Jackson mapping. Sort translation is optional and skipped if the domain class is not resolvable. Translation in the scope of a domain class maps property paths to apply sorting using embedded properties.

A sort string `nested-name` resolves to a property path `anotherWrap.embedded.name`.

class Aggregate {

	@JsonUnwrapped
	public UnwrapEmbedded anotherWrap;
}

class UnwrapEmbedded {

	@JsonUnwrapped(prefix = "nested-")
	public Embedded embedded;
}

class Embedded {
	public String name;
}

Original pull request: #232.
odrotbohm added a commit that referenced this pull request Dec 6, 2016
Minor code reorganizations. Eagerly create SortTranslator to avoid repeated instantiation.

Original pull request: #232.
odrotbohm pushed a commit that referenced this pull request Dec 6, 2016
odrotbohm pushed a commit that referenced this pull request Dec 6, 2016
We now support nested Sort properties considering Jackson mapping. Sort translation is optional and skipped if the domain class is not resolvable. Translation in the scope of a domain class maps property paths to apply sorting using embedded properties.

A sort string `nested-name` resolves to a property path `anotherWrap.embedded.name`.

class Aggregate {

	@JsonUnwrapped
	public UnwrapEmbedded anotherWrap;
}

class UnwrapEmbedded {

	@JsonUnwrapped(prefix = "nested-")
	public Embedded embedded;
}

class Embedded {
	public String name;
}

Original pull request: #232.
odrotbohm added a commit that referenced this pull request Dec 6, 2016
Minor code reorganizations. Eagerly create SortTranslator to avoid repeated instantiation.

Original pull request: #232.
@odrotbohm odrotbohm closed this Dec 6, 2016
@odrotbohm odrotbohm self-assigned this Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants