select new CatalogMoniker(c.Id, c.Name, c.Description ) from Catalog c
 WHERE :appUsage in elements(c.ApplicationUsages)
or
select new CatalogMoniker(c.Id, c.Name, c.Description ) from Catalog as
c, au in elements(c.ApplicationUsages) WHERE au.Id = :appUsageId

does not work ?

2010/2/24 MikeM <[email protected]>

> Ok I see that now in the release notes. Thanks.
> I also had to make another change. After I used the elements() I was
> still receiving an error: Antlr.Runtime.MissingTokenException
> Turned out that you need to use the "AS" when you define an alias.
> This version of the HQL worked:
>  "select new CatalogMoniker(c.Id, c.Name, c.Description ) from Catalog
> as c, elements(c.ApplicationUsages) as au WHERE au.Id = :appUsageId
> ORDER BY c.Name")
>
> Thanks for your help. Much appreciated.
>
> -Mike
>
> On Feb 24, 4:47 pm, Roger Kratz <[email protected]> wrote:
> > From the release notes for 2.1.2
> > "  * the syntax foo.bar.baz.elements or foo.bar.baz.indices is not longer
> supported.  Use the alternative syntax of elements(foo.bar.baz) or
> indices(foo.bar.baz) instead"
> >
> > ________________________________________
> > Från: [email protected] [[email protected]] f&#246;r MikeM
> [[email protected]]
> > Skickat: den 24 februari 2010 22:24
> > Till: nhusers
> > Ämne: [nhusers] HQL Quandary
> >
> > Hi all,
> >
> > I'm in the process (or at least trying) of upgrading our NH projects
> > from version 2.0.1 to 2.1.2 and I ran into an HQL issue that I can't
> > seem to resolve.
> >
> > I have the following HQL query:
> > return sessionManager.Session
> >         .CreateQuery(
> >                 "select new CatalogMoniker(c.Id, c.Name, c.Description )
> from
> > Catalog c, c.ApplicationUsages.elements au WHERE au.Id = :appUsageId
> > ORDER BY c.Name")
> >                 .SetString("appUsageId", pApplicationUsageId)
> >                         .List<CatalogMoniker>();
> >
> > which ran completely fin in version 2.0.1 but fails in 2.1.2 with the
> > following exception:
> > exception:  NHibernate.Hql.Ast.ANTLR.QuerySyntaxException:
> > c.ApplicationUsages.elements is not mapped [select new
> > CatalogMoniker(c.Id, c.Name, c.Description ) from
> > Himco.Catalog.Domain.Catalog c, c.ApplicationUsages.elements au WHERE
> > au.Id = :appUsageId ORDER BY c.Name].
> >
> > Does anyone have any ideas as to what changed or is wrong with this
> > query???  Thanks in advance for any help.
> >
> > -Mike
> >
> > --
> > 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 athttp://
> 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]<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].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to