System.InvalidCastException: Unable to cast object of type 'Antlr.Runtime.Tree.CommonTree' to type 'NHibernate.Hql.Ast.ANTLR.Tree.IASTNode'.

384 views
Skip to first unread message

Carsten Hess

unread,
Jun 11, 2009, 6:31:51 AM6/11/09
to nhusers
Bug or wrong HQL syntax ?


Using trunk revision 4453 from today.


const string hql = @"SELECT dt FROM DocumentType dt, AbstractConcept c
JOIN c.ActivityGroups ag JOIN ag.Activities a JOIN a.ActivityTemplate
at JOIN at.Action ac JOIN ac.Code co
WHERE dt.SystemAction & :sysAct
= :sysAct AND dt.Code = co AND c = :concept";
IQuery query = ((HibernateWorkspace)
Workspace).Session.CreateQuery(hql);
query.SetMaxResults(1);
query.SetEnum("sysAct", systemAction);
query.SetEntity("concept", concept);
return query.UniqueResult<IDocumentType>();



Its the bitwise anding with a parameter ('dt.SystemAction & :sysAct')
that is causing the problem.

Kind regards
Carsten

Carsten Hess

unread,
Jun 11, 2009, 6:47:06 AM6/11/09
to nhusers
Noticed too late it has been reported in JIRA - NH-1775 - as fixed.
I'm reopening it...

/Carsten

Fabio Maulo

unread,
Jun 11, 2009, 11:18:49 AM6/11/09
to nhu...@googlegroups.com
2009/6/11 Carsten Hess <carsten.hess.dk@gmail.com>

Noticed too late it has been reported in JIRA - NH-1775 - as fixed.
I'm reopening it...

Hi Carsten.
Well... reopening.... The NH-1775 has a specific test, provided by user, and it is now working; for this reason the issue was resolved as fixed.

If, in your case, something fails mean that your case is not identical to NH-1775.

And now a little curiosity.
Do you have some special reason to open 3 new issues with different title 2 with same description and no test ?
I mean...  with a little test you don't need to send us the stack-trace because we can see the same stack-trace in our box.

About NH-1833... follow your issue.
-- 
Fabio Maulo

Fabio Maulo

unread,
Jun 11, 2009, 2:15:22 PM6/11/09
to nhu...@googlegroups.com
The best way to have an issue fixed, quickly, is provide a failing test and/or enough info to create a failing test.
We can't "interpreter"/guess which is the problem because our test can be completely different from your real issue and we would avoid waste time fixing something that is not a real issue (exactly the same of the your).

The quality is not achieved by chance.

About NH-1833: Test self created and issue fixed (thanks to your last comment).

2009/6/11 Fabio Maulo <fabio...@gmail.com>



--
Fabio Maulo
Reply all
Reply to author
Forward
0 new messages