Ahh, ok. that makes allot more sense.
Gary On Wed, Jul 7, 2010 at 12:20 PM, Fabio Maulo <[email protected]> wrote: > the reason is that the new parser checks type compatibility and can't infer > the result-type of the inner select > > On Wed, Jul 7, 2010 at 3:36 PM, gary lucas <[email protected]> wrote: > >> Yup, that resolved it. >> >> Thank you very much. >> >> G >> >> On Jul 7, 10:59 am, Fabio Maulo <[email protected]> wrote: >> > yes... my suspect.... for that reason I was asking the remotion of that >> > part. >> > Now... >> > actr.GrossAmount > (Cast((slelec.... ) as decimal) * -1) >> > >> > >> > >> > >> > >> > On Wed, Jul 7, 2010 at 2:53 PM, gary lucas <[email protected]> >> wrote: >> > > Isolated the issue: >> > > ------ >> >> > > from >> > > Account act >> > > left join fetch act.AccountTransactions actr >> > > left join fetch actr.ChargeAppliedPayments cap >> > > left join fetch actr.PaymentAppliedPayments pap >> > > left join fetch actr.Type typ >> > > where >> > > act.Id = :Id >> > > and typ.ClassCode <> :payment >> > > and >> > > ( >> > > NOT EXISTS >> > > ( >> > > select >> > > pmt1.Id >> > > from >> > > AppliedPayment pmt1 >> > > join pmt1.ChargeAccountTransaction >> actr1 >> > > where >> > > actr1.Id = actr.Id >> > > ) >> > > OR actr.GrossAmount > - >> > > ( >> > > select >> > > sum(pmt2.Amount) >> > > from >> > > AppliedPayment pmt2 >> > > join pmt2.ChargeAccountTransaction >> actr2 >> > > where >> > > actr2.Id = actr.Id >> > > ) >> > > ) >> > > ORDER BY >> > > actr.Id asc >> > > ---------------- >> > >> > > The parser can't seem to handle the '-' sign in 'OR actr.GrossAmount >> > > > -' >> > >> > > Gary >> > >> > > On Jul 6, 3:55 pm, gary lucas <[email protected]> wrote: >> > > > I did try (random re-writing) commenting out one then the other >> parts >> > > > of the subquery... >> > >> > > > Both returned the same error. >> > >> > > > I'll take another look at it tomorow. >> > >> > > > Thank you both. >> > >> > > > Gary >> > >> > > > On Jul 5, 2:29 pm, Fabio Maulo <[email protected]> wrote: >> > >> > > > > First try removing this part >> >> > > > > OR >> > > > > actr.GrossAmount > >> > > > > -( >> > > > > select >> > > > > sum(pmt2.Amount) >> > > > > from AppliedPayment pmt2 >> > > > > join >> > > > > pmt2.ChargeAccountTransaction actr2 >> > > > > where >> > > > > actr2.Id = actr.Id >> > > > > ) >> > >> > > > > If it work the problem is there and we have to figure out how >> re-write >> > > it >> >> > >> > > > > On Wed, Jun 30, 2010 at 5:21 PM, gary lucas <[email protected] >> > >> > > wrote: >> > > > > > I'm in the process of migrating a fairly large application to >> > > > > > nHibernate 2.1.2 and most queries work, however this one is >> > > > > > problematic. >> > >> > > > > > ---------------------------------- >> > > > > > {"Exception of type 'Antlr.Runtime.NoViableAltException' was >> thrown. >> > > > > > [ >> > > > > > from Account act >> > > > > > left join fetch act.AccountTransactions actr >> > > > > > left join fetch actr.ChargeAppliedPayments cap >> > > > > > left join fetch actr.PaymentAppliedPayments pap >> > > > > > left join fetch actr.Type typ >> > > > > > where act.Id = :Id >> > > > > > and typ.ClassCode <> :payment >> > > > > > and ( >> > > > > > NOT EXISTS >> > > > > > (select >> > > > > > pmt1.Id >> > > > > > from >> > > > > > AppliedPayment pmt1 >> > > > > > join pmt1.ChargeAccountTransaction actr1 >> > > > > > where >> > > > > > actr1.Id = actr.Id >> > > > > > ) >> > > > > > OR >> > > > > > actr.GrossAmount > >> > > > > > -( >> > > > > > select >> > > > > > sum(pmt2.Amount) >> > > > > > from AppliedPayment >> pmt2 >> > > > > > join >> > > > > > pmt2.ChargeAccountTransaction actr2 >> > > > > > where >> > > > > > actr2.Id = >> actr.Id >> > > > > > ) >> > > > > > ) >> > > > > > ORDER BY actr.Id asc >> > > > > > -------------------------------------- >> > >> > > > > > in searching the forums I couldn't find allot of definitive >> answers >> > > on >> > > > > > the subject of antlr errors... I know the issue resides in the >> > > > > > subquery... However this worked in 1.2, and seems to have >> issues >> > > > > > now... >> > >> > > > > > Thank you >> > >> > > > > > Gary >> > >> > > > > > -- >> > > > > > 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]<nhusers%[email protected]> >> <nhusers%[email protected]<nhusers%[email protected]>> >> > > <nhusers%[email protected]<nhusers%[email protected]> >> <nhusers%252bunsubscr...@googlegroup s.com>> >> > > > > > . >> > > > > > For more options, visit this group at >> > > > > >http://groups.google.com/group/nhusers?hl=en. >> > >> > > > > -- >> > > > > Fabio Maulo >> > >> > > -- >> > > 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]<nhusers%[email protected]> >> <nhusers%[email protected]<nhusers%[email protected]>> >> > > . >> > > For more options, visit this group at >> > >http://groups.google.com/group/nhusers?hl=en. >> > >> > -- >> > Fabio Maulo >> >> -- >> 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]<nhusers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en. >> >> > > > -- > Fabio Maulo > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- 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.
