-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: 'ORDER BY' HQL clauses do not support embedded or joined properties
According to the HQL syntax: > The implicit form does not use the join keyword. Instead, the associations are "dereferenced" using dot-notation. implicit joins can appear in any of the HQL clauses. implicit join result in inner joins in the resulting SQL statement. > > from Cat as cat where cat.mate.name like '%s%' See: https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/queryhql.html#queryhql-joins-forms This means that implicit joins such as `cat.mate.name` can appear in a `where` clause, as shown above, but they can also appear in an `order by` clause as well. Currently this is not supported in HibernateD. Unfortunately, this means that ordering by a column that is in an `@Embeddable` class results in a syntax error. To support this capability, the same logic used to perform implicit joins for `where` clauses was used during an `order by` clause as well. Change Summary: - embeddedtest.d: Added additional tests for HQL queries using `order by`. - query.d: - Modify `parseOrderByClauseItem` to first call `convertFields` to combine tokens of the form `[Alias.]Ident[.Ident]...` into a single `Field` token. - Remove now obviated logic and checks from `parseOrderByClauseItem`. - Modify `convertFields` error messages so that they are no longer specific to `where` clauses. - Add comments to `convertFields` to make the algorithm easier to understand. The whitespace in query.d is still a mess, but that was not cleaned up in this PR.
- Loading branch information
1 parent
9ce43e6
commit d9bafb8
Showing
2 changed files
with
184 additions
and
136 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.