With many HQL queries, time and time again I am getting this exception:
Antlr.Runtime.NoViableAltException
This is really generic and unhelpful – does anyone know how best to debug this? Obviously it’s a problem with my HQL – but without any clue as to what exactly is wrong it’s very much a case of trial and error. I’m pulling my hair out every time I see this.
Note, I don’t want to post any HQL here, becuase it’s something that I am often coming across, not a problem related to one query.
Does anyone know the best way to tackle this? Is there any tool for validating HQL queries?
Have a look at NHibernate Query Analyzer. It is not perfect, but it will be helpful in many situations.