I'm posting the last trail of my
last topic as a new topic that represents the current issue. I hope this isn't against the etiquette here.
The new query translator translates my query differently than the old. This causes a SQL error to be thrown for this query. Here's the query:
<query name="troubletickets.getSolvedCategories">
SELECT DISTINCT t.category
FROM Ticket t
WHERE t.status = 'closed'
ORDER BY t.category.name
</query>
Here's the sql generated by the new QueryTranslator:
select distinct category1_.id as id, category1_.name as name2_, category1_.description as descript3_2_, category1_.disabled as disabled2_, category1_.changed as changed2_, category1_.created as created2_, category1_.changed_usr_id as changed7_2_, category1_.created_usr_id as created8_2_ from troubletickets_faqs faq0_, troubletickets_categories category1_, troubletickets_categories category2_ where (faq0_.trca_id=category1_.id and faq0_.trca_id=category2_.id) order by category2_.name
Here's the sql generated by the ClassicQueryTranslator:
select distinct category1_.id as id, category1_.name as name2_, category1_.description as descript3_2_, category1_.disabled as disabled2_, category1_.changed as changed2_, category1_.created as created2_, category1_.changed_usr_id as changed7_2_, category1_.created_usr_id as created8_2_ from troubletickets_faqs faq0_, troubletickets_categories category1_ where faq0_.trca_id=category1_.id order by category1_.name
The SQL from the ClassicQueryTranslator matches my expectations based on the query. The SQL from the new QueryTranslator causes a SQL error to be thrown saying that fields in the ORDER BY of a SELECT DISTINCT must appear in the select list. Should I file this as a bug in JIRA?