Java Mailing List Archive

http://www.gg3721.com/

Home » the NHibernate development list »

[NHibernate-development] ICriteria Subqueries Patch with sql 2005
 Paging Fixes

Will Shaver

2008-07-17


Author LoginPost Reply
http://jira.nhibernate.org/browse/NH-1359
 
I spent pretty much all day getting several different bugs worked out of the criteria subquery projection code. Several of the bugs that I worked on were in the sql 2005 paging code, so if people had problems getting things to work before it may be worth taking a look at this patch. I have a passing unit test that uses:
 * Filter Parameters
 * Criteria Subqueries
 * Sorting
 * Paging
 * Subquery and outer query restrictions
 * Relationships in subquery and outer query
 
It was a major pain to get all of these pieces working together... but I'm now using it in my application to do auto-column sorting on a grid view off of a subselect which is 4 relationships away from the primary entity!
 
The previous sql 2005 paging code assumed that it needed to create an alias for everything it was going to page such as: "__hibernate_sort_expr_1__" This caused missing parameters to occur in subselects and I believe other things such as switch-case statements. I've replaced this with some logic that determines if that exact same column or subquery is already being selected and doesn't duplicate it if so. This also means easier to debug log files. :)
 
Enjoy...
 
 -Will
 
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nhibernate-development mailing list
Nhibernate-development@(protected)
https://lists.sourceforge.net/lists/listinfo/nhibernate-development
©2008 gg3721.com - Jax Systems, LLC, U.S.A.