It's not a secret anymore!*
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
wood burning stoves
 
subject: Many to Many relationship Query in hibernate
 
Similar Threads
SQL error
Help required with DB pagination
Inner join in Hibernate
Data type mismatch need to convert string to a number
how to query this in Spring and Hibernate