search utility using struts, hibernate
posted 11 years ago
I tried searching the forum couldn't found the exact or similar solution. I have a search page (jsp) with free form text field, multi selection boxes and etc. I want to build a search utility class, which can be passed to hibernate layer (seperate from presentaion layer). I don't want to pass hardcoded query to hibernate layer rather want to pass some kind of "SearchQuery" object to hibernate layer, which in turn can fire a query to get the result back. Search paraameters are from different tables so not sure how to use Criteria interface with multiple tables/objects. Simple solution I could think of is; since i have actionform populated with selected search params, I can pass simple value object (java bean) to hibernate layer. Could anyone reply with examples? I am not an expert in hibernate so any help would be much appreciated.