Add support for @OrderBy

Description

We do not yet support ordered collections via @OrderBy.

I initially thought that'd be handled by ORM internally so we'd benefit from it, but actually the specified order columns are appended to the WHERE clause of the collection fetch statement.

We could do the following:

  • Expose the order column(s) through association context to getAssciation() so dialects can apply the ordering upon fetching as well

  • If a dialect indicates that it doesn't support ordered fetches, we'd apply the ordering in core as a fallback

Thoughts?

Environment

None

Assignee

Unassigned

Reporter

Gunnar Morling

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

Yes, likely

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Priority

Major
Configure