This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Many to Many relationship Query in hibernate 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 » Databases » Object Relational Mapping
Bookmark "Many to Many relationship Query in hibernate" Watch "Many to Many relationship Query in hibernate" New topic
Author

Many to Many relationship Query in hibernate

Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi Good People,

I am stuck in many-to-many relationship problem in Hibernate. I have the following scenario:



As you can see third table implementing M:M relationship.

Now i want to display in the UI like :

List of products along with total number of customers in each product.

I have made database query for this problem like :




after that i am unable to understand how should i map this query to any object class ?

Please suggest me if any one has any idea?

Thanks and Regards,
Khushwinder
 
jQuery in Action, 2nd edition
 
subject: Many to Many relationship Query in hibernate
 
Similar Threads
Data type mismatch need to convert string to a number
Inner join in Hibernate
SQL error
Help required with DB pagination
how to query this in Spring and Hibernate