I've got some code that takes a list of properties and parameters and
turns them into a SQL statement that returns a list of IDs for objects
that match the search. I need to query over the results of this in a
paged fashion.

Currently I use the output of this code like so:

.Session.CreateSQLQuery(
                                        @"SELECT {s.*}
                                                FROM Sample {s}
                                                INNER JOIN (" + 
filter.BuildSQLStatement() + @") filter
                                                        ON {s}.SampleID = 
filter.ParentID
                                        ORDER BY {s}.SampleID DESC"
                                        ).AddEntity("s", typeof(Sample))
                                        .SetFirstResult((PageNumber - 1) * 
PageSize)
                                        .SetMaxResults(PageSize)
                                        .List<Sample>();

I suspect there is a better way to join against this filter- is there?
I'm using NH 3.0 alpha.

-- 
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