I have very complex sql queries for list pages. Expressing them in HQL
is really impossible.
Usually queries have following properties:
1) Join of 3-4 tables
2) Dynamic sorting on user selected column
3) Dynamic filtering on user selected column, filter type (like,
exact, starts)
4) 2) and 3) could be often applied on result of join - so include
filtering on column that is combination of orignal columns

All works good enough. The only problem is that NHibernate Query.LIst
return object array instead of domain objects (because it includes
columns from different tables).  Hql have technique known as
projection when you could create new not persistent object for such
reporting queries. Are there any way to do this in sql queris? On
currnet moment I am using some type of hacks. For real persistent
objects are use following mappings:
<class name="Person"  table="Persons" >
For report objects are use mapping to fake tables:
<class name="CustomResults.PersonListItem"  table="PersonsList" >.

This seem to me bad design but I have no other ideas how ho receive
objects from array lists.
Does anyone have some ideas?

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