My advice about NH's queries http://fabiomaulo.blogspot.com/2009/09/nhibernate-queries.html
<http://fabiomaulo.blogspot.com/2009/09/nhibernate-queries.html>Look at "Conclusion" On Sun, Apr 25, 2010 at 6:41 AM, Mohamed Meligy <[email protected]>wrote: > So, personally thinking the most recent API would probably have the most > correct behavior, do you think the correct behavior is the Int32 row count > or Int64? > > I think if IQueryOver returns Int32 then there will likely be cases where > users have to ignore the IQueryOver API just because of large row count, not > anything specific to the other APIs. > If it returns Int64 instead, the vast majority of users with row count in > Int32 range will not be upset still. > > I remember Fabio calling the IQueryOver API as "Criteria on > NH3.0.0<http://fabiomaulo.blogspot.com/2009/06/criteria-on-nh300.html>". > So, it sounds like it's recommended as default criteria API. Would you > advise users to look for other APIs just for the sake of a larger row count > data type? > > -- > Mohamed Meligy > Senior Developer, Team Lead Backup (.Net Technologies - TDG - Applications) > Injazat Data Systems > P.O. Box: 8230 Abu Dhabi, UAE. > > Phone: +971 2 6992700 > Direct: +971 2 4045385 > Mobile: +971 50 2623624, +971 55 2017 621 > > E-mail: [email protected] > Weblog: http://gurustop.net > > > On Sun, Apr 25, 2010 at 8:48 AM, Fabio Maulo <[email protected]> wrote: > >> IMO, No >> there is not an "strongly" necessity to have HQL compatibility with >> neither QueryOver nor Criteria.. >> Different API different behavior... no problem >> >> On Sat, Apr 24, 2010 at 10:48 AM, FlukeFan <[email protected]>wrote: >> >>> Fabio, >>> >>> The current IQueryOver.RowCount() wraps the Projections.RowCount() ... >>> should we change it to wrap the Projections.RowCountInt64() instead? >>> >>> >>> On Apr 23, 11:04 pm, Fabio Maulo <[email protected]> wrote: >>> > HQL returns Int64 since long time ago. >>> > Criteria has 2 methods because back draw-compatibility >>> > RowCount and RowCountInt64 >>> > >>> > Probably in QueryOver the method in use is RowCount. >>> > >>> > >>> > >>> > >>> > >>> > On Fri, Apr 23, 2010 at 6:48 PM, Tuna Toksoz <[email protected]> >>> wrote: >>> > > seemed like a bug. >>> > >>> > > Tuna Toksöz >>> > > Eternal sunshine of the open source mind. >>> > >>> > >http://devlicio.us/blogs/tuna_toksoz >>> > >http://tunatoksoz.com >>> > >http://twitter.com/tehlike >>> > >>> > > On Sat, Apr 24, 2010 at 12:40 AM, Jason Dentler < >>> [email protected]>wrote: >>> > >>> > >> I have these working queries: >>> > >>> > >> var movieCountQuery = session.QueryOver<Movie>() >>> > >> .Select(list => list >>> > >> .SelectCount(m => m.Id)); >>> > >>> > >> var moviePageQuery = session.QueryOver<Movie>() >>> > >> .Skip((pageNumber - 1) * pageSize) >>> > >> .Take(pageSize); >>> > >>> > >> var multiCrit = session.CreateMultiCriteria() >>> > >> .Add<int>("count", movieCountQuery.UnderlyingCriteria) >>> > >> .Add<Movie>("page", moviePageQuery.UnderlyingCriteria); >>> > >>> > >> var countResult = ((IList<int>)multiCrit >>> > >> .GetResult("count")).First(); >>> > >>> > >> var pageResult = (IList<Movie>) multiCrit >>> > >> .GetResult("page"); >>> > >>> > >> vs. the same thing in HQL: >>> > >>> > >> var movieCountQuery = session.CreateQuery( >>> > >> @"select count(m.Id) from Movie m"); >>> > >>> > >> var moviePageQuery = session.CreateQuery( >>> > >> @"from Movie m") >>> > >> .SetFirstResult((pageNumber - 1) * pageSize) >>> > >> .SetMaxResults(pageSize); >>> > >>> > >> var mq = session.CreateMultiQuery() >>> > >> .Add<Int64>("count", movieCountQuery) >>> > >> .Add<Movie>("page", moviePageQuery); >>> > >>> > >> var countResult = ((IList<Int64>)mq >>> > >> .GetResult("count")).First(); >>> > >>> > >> var pageResult = (IList<Movie>)mq >>> > >> .GetResult("page"); >>> > >>> > >> I doubt this is related to multicriteria or multiquery, but I >>> haven't >>> > >> taken the time to isolate it yet. When I switch the Criteria count >>> query to >>> > >> Int64, it blows up. When I switch the HQL count query to Int32, it >>> blows >>> > >> up. >>> > >>> > >> Does anyone know why these return different size integers? >>> > >>> > >> Thanks, >>> > >> Jason >>> > >>> > >> -- >>> > >> 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. >>> > >>> > -- >>> > 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 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]<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.
