the beta version of nh include ToFuture and ToFutureValue for Linq
My question is.... How can i do the example below in Linq:
var persons = s.CreateQuery("from Person")
.SetMaxResults(10)
.Future<Person>();
var personCount = s.CreateQuery("select count(*) from
Person")
.FutureValue<long>();
Thanks in advance
On Aug 28, 8:34 am, Fabio Maulo <[email protected]> wrote:
> btw you can add a ticket in our JIRA to support Future feature even for LINQ
> provider.
>
>
>
> On Sat, Aug 28, 2010 at 9:52 AM, Sal <[email protected]> wrote:
> > OK, well I will look into that. The idea is to get something friction-
> > less for simple scenarios where you are doing,for example, paging and
> > sorting on a UI, and want to push those queries through to NH in an
> > easy manner. We were doing NH linq queries, combined with dynamic
> > queryable (for sorting based off the string name of a field). I wanted
> > to try to use futures to wrap the query for the data and the query for
> > the total records into one DB call.That was trivial with criteria, but
> > not so much with linq.
>
> > I will have to look into queryover.
>
> > On Aug 28, 4:51 am, Mohamed Meligy <[email protected]> wrote:
> > > I'd highly suggest you play with QueryOVer if this is possible in your
> > case
> > > (bet possible means: you want something as easy/familiar as LINQ, but you
> > do
> > > not have to use/expose IQueryable<> interface).
> > > It has Futures() and it seems the best query way to go for most queries
> > in
> > > NH 3.0, unless you have specific reasons to use others (Let the "there
> > are
> > > so many ways and it depends on your situation ..." replies begin :)).
>
> > > *Mohamed Meligy*
>
> > > On Sat, Aug 28, 2010 at 5:57 PM, Frans Bouma <[email protected]> wrote:
> > > > In v3, the linq provider is transforming to an AST for the hql
> > pipeline,
> > > > not
> > > > to criteria as the v2 one did. So that means it doesn't really is
> > possible
> > > > to 'get' the criteria executed, as there's no set of criteria objects
> > > > created.
>
> > > > FB
>
> > > > > Yes, hopefully someone familiar with the new NH 3 Linq provider can
> > point
> > > > us
> > > > > in the right direction. This seems like an issue many people will
> > come
> > > > > across.
>
> > > > > On Aug 27, 5:43 pm, taber loveless <[email protected]> wrote:
> > > > > > I too am working on this exact issue... I hope someone can help us
> > > > > > out!
>
> > > > > > On Aug 27, 2:42 pm, Sal <[email protected]> wrote:
>
> > > > > > > OK, Let me try a different approach. This page
> > > > > here:
> >http://rndnext.blogspot.com/2009/05/using-nhibernate-multicriteria-
> > > > > an...
> > > > > > > explains how to use the NHibernateQueryTranslator to convert a
> > linq
> > > > > > > query to criteria. Problem is, looking at NH 3, I do not see the
> > > > > > > NHibernateQueryTranslator class. I'm guessing this was completely
> > > > > > > re- written.
>
> > > > > > > So, the question becomes, rather than have dependency on the old
> > > > > > > Linq provider and NHibernateQueryTranslator , how can I use the
> > new
> > > > > > > NH 3 Linq classes to translate a query to criteria? Basically,
> > the
> > > > > > > end goal is to be able to add support for multi-criteria, or even
> > > > > > > better the use of Future<T>.
>
> > > > > > > Thanks.
>
> > > > > > > On Aug 27, 12:17 pm, Sal <[email protected]> wrote:
>
> > > > > > > > Hi Guys,
>
> > > > > > > > Is there some way to use Future or other query batching with
> > Linq
> > > > > > > > and NH? I have a linq query (for paging) that gets the total
> > > > > > > > number of records, as well as a list of entities and I'd like
> > to
> > > > > > > > issue the query in one call. This is easy with criteria and
> > > > > > > > future, but how about Linq?
>
> > > > > --
> > > > > 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]>
> > <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.