• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts2 + hibernate dynamic search criteria

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
A teeny tiny vulgar attempt to get you to buy our stuff
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic