This will be really difficult (if not impossible) until our Antlr HQL parser code is revamped. SQL Queries, like this one, are generated too soon for multi-table mappings to be resolved correctly.