The official Fatica Labs Blog! RSS 2.0
# Wednesday, July 14, 2010

Apprendo da questo post di Fabio Maulo una interessante feature di NHibernate 3 implementata nel nuovo subset di API: QueryOver. Il post di Fabio approfondisce il pattern Query Object, e quello che salta all’occhio è la pulizia con cui si riesca finalmemte a farte un paging “ad arte”. Per fare l’accesso paginato in generale occorre avere il count delle righe che il sistema vorrebbe tornarci, e questo constringeva in passato a fare delle implementazioni un po’ sporche in cui si era costretti a specificare la query di selezione e quella di count. QueryOver propone la funzione query.ToRowCountQuery(); – dove query è appunto una query di QueryOver, e la funzione ci restituisce la query di conteggio in modo pulito e trasparente. Assolutamente molto utile. Io non sono uno da trunk, ma una funzione del genere mi fa venire voglia di passare subito a NH3, ancor prima che venga rilasciata la GA.

Wednesday, July 14, 2010 8:50:20 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
NHibernate

All comments require the approval of the site owner before being displayed.
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, strike, strong) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
My Stack Overflow
Contacts

Send mail to the author(s) E-mail

Tags
profile for Felice Pollano at Stack Overflow, Q&A for professional and enthusiast programmers
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Felice Pollano
Sign In
Statistics
Total Posts: 143
This Year: 3
This Month: 0
This Week: 0
Comments: 105
This blog visits
All Content © 2012, Felice Pollano
DasBlog theme 'Business' created by Christoph De Baene (delarou) and modified by Felice Pollano