Yes, the two countries can be different but that's not the point. As I said I know that by rewriting the query it can be made to work, but the fact of being forced to use a join to avoid a path expression limits considerably the expressiveness of an object-oriented query language.
The query I've pasted is not really present in my system, indeed I have taken a query that has the error and I've reduced it as much as possible to make the error repeatable. The real query is created using a query generator that builds filters on the fly based on the user's input. These filters can be extended by a HQL-aware system administrator. This means that the path expressions in the SELECT clause and in the WHERE clause are not predictable when writing the core FROM clause, because I cannot foresee every possible related entity to join to the main one. I think the problem may be in the Antlr rules for turning a HQL AST to an SQL string: I've had a look at the code and by some comments that can be found there, there seems to be some problem/indecision in the theta join clause, On 2 Set, 00:12, Fabio Maulo <[email protected]> wrote: > orselect p.Country.Name from Site s join s.Parent p with p.Country = > s.Country > 2009/9/1 Fabio Maulo <[email protected]> > > > > > but I don't understand your designselect > > p.Country.Name<http://Parent.Country.Name> from > > Site s join s.Parent p join s.Country c > > > perhaps should be > > select c.Name <http://Parent.Country.Name> from Site s join s.Parent > > p join s.Country c > > > or should be > > select c.Name <http://Parent.Country.Name> from Site s join s.Parent > > p join p.Country c > > > or in your domain a child Site can have a different "Country" than the > > Parent-Site ? > > > 2009/9/1 Gabriele Tassi <[email protected]> > > >> As for the query with lower-case aliases, same problem, same generated > >> Sql ;( > > > -- > > Fabio Maulo > > -- > Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
