-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
4
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Summary
In https://jira.mongodb.org/browse/HIBERNATE-68, we throw exception when some sort key doesn't correspond to some field path. E.g. the following HQL sorting is based on function invocation result on field path:
from Book b order by length(b.title)
because MQL only supports field path type sorting key.
However, we could translate the above HQL by emulating as belows:
- insert a `$addFields` stage prior to `$sort` stage with unique field name
- compute the new field value based on expression with operator corresponding the SQL function ($strLenBytes or $strLenCP)
- sort on the new field based on its unique name
We could also solve the other edge case in https://jira.mongodb.org/browse/HIBERNATE-68, i.e. emulating sorting specification ignoring case in SQL translation, for we could simply follow the above idea by using $toLower operator.
Motivation
Who is the affected end user?
potential hibernate product users
How does this affect the end user?
some existing HQL based on function-based sorting key won't work
How likely is it that this problem or use case will occur?
Main path? Edge case?
If the problem does occur, what are the consequences and how severe are they?
some missing HQL feature
Is this issue urgent?
no
Is this ticket required by a downstream team?
no
Is this ticket only for tests?
no
Addressing the source code notes tagged with TODO-HIBERNATE-79 is in scope of this ticket.
- depends on
-
HIBERNATE-68 sorting MQL translation
-
- Closed
-