Instead session.CreateQuery
you can write session.GetNamedQuery
a named query can be an HQL or a SQL or a H-SQL
All queries wrote in the mapping are checked and compiled at
BuildSessionFactory

Dynamic queries as Criteria and QueryOver are dynamically created an so
interpreted/translated each time.

For Linq (in NH trunk) we are working to avoid the translation each time (it
need a "little" overhead to calculate the hashcode of the Linq sentence).

2010/2/17 Ricardo Peres <[email protected]>

> Hi, Gustavo!
>
> I didn't mean named queries, but those created with CreateQuery(String
> queryString).
> On a side note, if named queries are compiled at the beginning, it
> means that we cannot have multiple queries, for different DB engines,
> because some of them will not compile, is that so?
>
> Thanks,
>
> RP
>
> On Feb 17, 1:15 pm, Gustavo Ringel <[email protected]> wrote:
> > HQL named queries are compiled at the beggining.
> >
> > Gustavo.
> >
> >
> >
> > On Wed, Feb 17, 2010 at 2:50 PM, Ricardo Peres <[email protected]>
> wrote:
> > > Hello,
> >
> > > Does NHibernate support compilation of queries (HQL, Criteria, LINQ)?
> > > I was looking for ways to speed up the generation of the actual SQL, I
> > > assume it has to be done each time a query is List()ed, or is there a
> > > query cache for HQL, Criteria and LINQ?
> >
> > > Thanks!
> >
> > > Ricardo Peres
> >
> > > --
> > > 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.
>
> --
> 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