Two Laptop Bag*
The moose likes Struts and the fly likes struts2 + hibernate dynamic search criteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 + hibernate dynamic search criteria" Watch "struts2 + hibernate dynamic search criteria" New topic
Author

struts2 + hibernate dynamic search criteria

vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
Hi all,
I am using struts2+ hibernate
1) I have one table which have approximately 40 - 50 columns (basically a questionaire)
2) I have a query page in which i want to do the following
a) There will be two lists ... 1 for the main search criteria ( the column names) and 1 for the unique values for each list
Eg List 1 --> Fruits,Vegetables,Cars List2 --> Apple,Banana,Orange (for Fruits) or List2 --> Cabbage,Beans(for Vegetable)
List2 depends on the selected value of the List1
b) Since the number of columns is much , it is not possible to display each and every criteria in the search page. (I am using hibernate criterion search to minimise the results)
c) So i want to dynamically create the search condition based on a button "ADD MORE SEARCH"
Eg Search1 : Fruits Value: Apple ==> If user clicks on "ADD MORE SEARCH"
Search2 : Taken before meal Value: Yes

Eg Search1 : Cars Value: Family ==> If user clicks on "ADD MORE SEARCH"
Search2 : Type Value: BMW ==> If user clicks on "ADD MORE SEARCH"
Search3 : Insurance Value: Yes

My question is as follows :
1. What will be the best approach to implement the "ADD MORE SEARCH" facilities .. any tutorial guide/links will be greatly appreciated <this is where i am stuck>
2. I am planning to store the Column Name with the Value in a map , and iterate those map in the hibernate criterion search .. Is this the best approach ??
3. Any report generation tool in java which can do the above .. any tutorial guide/links will be greatly appreciated

Every kind of help/suggestions is greatly needed ..

Thanks in advance,
Vanlal

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 + hibernate dynamic search criteria
 
Similar Threads
Struts2 + Hibernate
struts2 + display tags + maps
Struts2/JQuery
iterate problem in struts2
Iterating a Array in Struts2