This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I really hope someone could help as I been struggling with an issue with hibernate and a spring mvc app. I must be doing something silly and was hoping someone could help.
I have the following relationships
1) SiteMenu has many MenuSection
2) SiteMenu has one Site
2) MenuSection has Many Products
I simply trying to retrieve a SiteMenu object which contains all the MenuSecions and associated Products. However when I add the products to my hibernate mapping (MenuSection.hbm), I receive duplicate MenuSection objects in my query. Removing the products association returns the correct number of MenuSections.
Here are the Hibernate Mappings
Here is my Criteria query
Why is it if I introduce products it duplicates the records returned? Can some please help as I am not sure what to do?