OK, this is slightly off-topic, but would anyone have an good idea to share about how to implement a multi-criteria search screen powered by a CreateCriteria? :roll:
The question is basically: what is the best way to pass search criteria between presentation layer and NHibernate in a business layer? In a really flexible search with a complex object tree I feel like I'd need to bind my controls on the search screen and then to pass the whole set of Properties and their values as a Hashtable, so the Criteria would be build from it... It sounds a bit "hairy", esp. in cases where I have to nest calls to createCriteria() - so my UI controls would have to "know" nearly as much as hbm.xml files to pass all relationships properly. Hmmm... Am I missing something? Any pointers to right directions would be appreciated!
Thanks!
|