And here is the mapping file:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="TestApp.Fax" namespace="TestApp.Fax">
<joined-subclass name="ReceivedFax" proxy="ReceivedFax"
table="ReceivedFax_" extends="TestApp.AttachedDocument,TestApp">
<key column="AttachedDocumentOID_" />
<property name="Status" column="Status_"
type="TestApp.Fax.Hibernate.ReceivedFaxStatusEnumHbm,
TestApp.Fax.Hibernate" not-null="true" access="nosetter.camelcase-
underscore"/>
<property name="StateChangeTime" column="StateChangeTime_"
type="DateTime" not-null="true" access="nosetter.camelcase-underscore"/
>
<property name="PageCount" column="PageCount_" type="int"/>
<many-to-one name="ReceivingFaxMachine" class="FaxMachine"
column="ReceivingFaxMachineOID_" not-null="true" fetch="join"/>
<property name="SenderName" column="SenderName_" type="string"
length="256"/>
<property name="SenderNumber" column="SenderNumber_"
type="string"
length="32"/>
</joined-subclass>
</hibernate-mapping>
On Nov 15, 11:32 am, Jorge <[email protected]> wrote:
> OK, here is my failing query:
>
> select distinct fm from ReceivedFax f join f.ReceivingFaxMachine fm
> where fm.Deactivated = :deactivated and f.Status in (:new, :detached)
>
> The exception is thrown in the Match() call of the following method:
>
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> public HqlParser.identifier_return identifier() // throws
> RecognitionException [1]
> {
> HqlParser.identifier_return retval = new
> HqlParser.identifier_return();
> retval.Start = input.LT(1);
>
> IASTNode root_0 = null;
>
> IToken IDENT292 = null;
>
> IASTNode IDENT292_tree=null;
>
> try
> {
> // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src
> \\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:659:2: ( IDENT )
> // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src
> \\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:659:4: IDENT
> {
> root_0 = (IASTNode)adaptor.GetNilNode();
>
> IDENT292=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_identifier3551);
> IDENT292_tree = (IASTNode)adaptor.Create(IDENT292);
> adaptor.AddChild(root_0, IDENT292_tree);
>
> }
>
> retval.Stop = input.LT(-1);
>
> retval.Tree =
> (IASTNode)adaptor.RulePostProcessing(root_0);
> adaptor.SetTokenBoundaries(retval.Tree, (IToken)
> retval.Start, (IToken) retval.Stop);
> }
> catch (RecognitionException ex)
> {
>
> retval.Tree = HandleIdentifierError(input.LT(1),ex);
>
> }
> finally
> {
> }
> return retval;
> }
> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
> I've also taken the liberty of including my stack trace:
>
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.RecoverFromMismatchedToken(Antlr.Runtime.IIntStream
> input =
> {selectdistinctfmfromReceivedFaxfjoinf.ReceivingFaxMachinefmwherefm.Deactivated=:deactivatedandf.Statusin(:new,:detached)},
> int ttype = 123, Antlr.Runtime.BitSet follow = {1}) Line 111 + 0x31
> bytes C#
> [External Code]
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.identifier() Line
> 10715 + 0x35 bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.primaryExpression() Line 8658 + 0xc
> bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.atom() Line 8367 +
> 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.unaryExpression()
> Line 7478 + 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.multiplyExpression() Line 7108 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.additiveExpression() Line 6966 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.bitwiseAndExpression() Line 6864 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.bitwiseXOrExpression() Line 6764 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.bitwiseOrExpression() Line 6664 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.bitwiseNotExpression() Line 6600 +
> 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.concatenation()
> Line 6420 + 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.relationalExpression() Line 5792 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.equalityExpression() Line 5565 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.negatedExpression() Line 5468 + 0xc
> bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.logicalAndExpression() Line 5307 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.logicalOrExpression() Line 5207 +
> 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.expression() Line
> 5145 + 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.compoundExpr()
> Line 9971 + 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.inList() Line 6259
> + 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.relationalExpression() Line 6010 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.equalityExpression() Line 5565 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.negatedExpression() Line 5468 + 0xc
> bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.logicalAndExpression() Line 5333 +
> 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.logicalOrExpression() Line 5207 +
> 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.expression() Line
> 5145 + 0xc bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.HqlParser.logicalExpression() Line 5087 + 0xc
> bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.whereClause() Line
> 4842 + 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.queryRule() Line
> 1623 + 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.selectStatement()
> Line 1227 + 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParser.statement() Line
> 431 + 0xc bytes C#
> NHibernate.dll!NHibernate.Hql.Ast.ANTLR.HqlParseEngine.Parse() Line
> 493 + 0x10 bytes C#
> NHibernate.dll!
> NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(string
> queryString = "select distinct fm from ReceivedFax f join
> f.ReceivingFaxMachine fm where fm.Deactivated = :deactivated and
> f.Status in (:new, :detached)", string collectionRole = null, bool
> shallow = false,
> System.Collections.Generic.IDictionary<string,NHibernate.IFilter>
> filters = Count = 0, NHibernate.Engine.ISessionFactoryImplementor
> factory = {NHibernate.Impl.SessionFactoryImpl}) Line 19 + 0x4d bytes
> C#
> NHibernate.dll!
> NHibernate.Engine.Query.HQLStringQueryPlan.CreateTranslators(string
> hql = "select distinct fm from ReceivedFax f join
> f.ReceivingFaxMachine fm where fm.Deactivated = :deactivated and
> f.Status in (:new, :detached)", string collectionRole = null, bool
> shallow = false,
> System.Collections.Generic.IDictionary<string,NHibernate.IFilter>
> enabledFilters = Count = 0,
> NHibernate.Engine.ISessionFactoryImplementor factory =
> {NHibernate.Impl.SessionFactoryImpl}) Line 24 + 0x9f bytes C#
> NHibernate.dll!
> NHibernate.Engine.Query.HQLStringQueryPlan.HQLStringQueryPlan(string
> hql = "select distinct fm from ReceivedFax f join
> f.ReceivingFaxMachine fm where fm.Deactivated = :deactivated and
> f.Status in (:new, :detached)", string collectionRole = null, bool
> shallow = false,
> System.Collections.Generic.IDictionary<string,NHibernate.IFilter>
> enabledFilters = Count = 0,
> NHibernate.Engine.ISessionFactoryImplementor factory =
> {NHibernate.Impl.SessionFactoryImpl}) Line 16 + 0x3e bytes C#
> NHibernate.dll!
> NHibernate.Engine.Query.HQLStringQueryPlan.HQLStringQueryPlan(string
> hql = "select distinct fm from ReceivedFax f join
> f.ReceivingFaxMachine fm where fm.Deactivated = :deactivated and
> f.Status in (:new, :detached)", bool shallow = false,
> System.Collections.Generic.IDictionary<string,NHibernate.IFilter>
> enabledFilters = Count = 0,
> NHibernate.Engine.ISessionFactoryImplementor factory =
> {NHibernate.Impl.SessionFactoryImpl}) Line 10 + 0x2c bytes C#
> NHibernate.dll!
> NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(string
> queryString = "select distinct fm from ReceivedFax f join
> f.ReceivingFaxMachine fm where fm.Deactivated = :deactivated and
> f.Status in (:new, :detached)", bool shallow = false,
> System.Collections.Generic.IDictionary<string,NHibernate.IFilter>
> enabledFilters = Count = 0) Line 61 + 0x4e bytes C#
> NHibernate.dll!
> NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(string query =
> "select distinct fm from ReceivedFax f join f.ReceivingFaxMachine fm
> where fm.Deactivated = :deactivated and f.Status in
> (:new, :detached)", bool shallow = false) Line 294 + 0x83 bytes C#
> NHibernate.dll!
> NHibernate.Impl.AbstractSessionImpl.CreateQuery(string queryString =
> "select distinct fm from ReceivedFax f join f.ReceivingFaxMachine fm
> where fm.Deactivated = :deactivated and f.Status in
> (:new, :detached)") Line 273 + 0x37 bytes C#
> Test.App.Hibernate.dll!
> Test.App.Hibernate.PersistenceContext.CreateHibernateQuery(string hql
> = "select distinct fm from ReceivedFax f join f.ReceivingFaxMachine
> fm where fm.Deactivated = :deactivated and f.Status in
> (:new, :detached)") Line 208 + 0x3c bytes C#
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
> I will work on a test case.
>
> Thanks,
> Jorge
>
> On Nov 12, 4:45 pm, José F. Romaniello <[email protected]> wrote:
>
> > Yo should star debugging until you get the exception, then copy your
> > failing query here.
> > I assume that you dont have failing any tests, which is the way we
> > alway should work, writing test for each query-scenario.
>
> > 2010/11/12, Jorge <[email protected]>:
>
> > > I am not sure where the exception is being thrown,
> > > but I presume it happens when executing a HQL query.
>
> > > Where is a good place to catch this exception?
>
> > > On Nov 12, 3:51 pm, José F. Romaniello <[email protected]> wrote:
> > >> when executing a hql query?
>
> > >> 2010/11/12 Jorge <[email protected]>
>
> > >> > I am running NH from trunk. And I got the following exception:
>
> > >> > A first chance exception of type
> > >> > 'Antlr.Runtime.MismatchedTokenException' occurred in NHibernate.dll
>
> > >> > Does anyone have insight into what is causing this?
>
> > >> > Thanks!
>
> > >> > Jorge
>
> > >> > --
> > >> > 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
>
> ...
>
> read more »
--
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.