Hi,
I am designing one survey system. Following is the details:
- One survey can have many questionpages
- One questionpage can have many questionsections
- One questionsection can have many questions
- One question can have many answers
- One answer can have many features
- One feature can have many rules
I am using many-to-one relationship and keeping bags in hbm.xml. Also using OSIV pattern to avoid n+1 select problem.
I am allowing admin to create survey, questionpages, questionsets,question,answers,features(automatically inserted) and define rules on that.
Now, I need everything when I display the page. I am using Object Graph so, I can navigate and easily display data on UI. But in this case, many queries are fired. Think one answer as one object. Then Features are associated, rules are associated etc.
I am bit confused desigining point of view. Can anyone give the suggestion on this?
Thanks,
Bhavin
|