wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Hibernate many-to-many problem 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 "Hibernate many-to-many problem" Watch "Hibernate many-to-many problem" New topic
Author

Hibernate many-to-many problem

Alex Kruglov
Greenhorn

Joined: May 06, 2008
Posts: 8
Hi, guys!

I have two entities: the first is Publication, which is categorized by the second entity, Tag

Source code follows:




I have to select publications with and without tags (LEFT OUTER JOIN) and then paginate these results with methods setFirstResult and setMaxResults.

1. If use like this

This way I don't get publications without tags.

2. If use like this

This way I get wrong pagination (because I setMaxResults and setFirstResult work for all result rows, not for publications)

Is there any solution to solve both problems? :roll:
Madhucar Gupta
Greenhorn

Joined: Aug 28, 2008
Posts: 1
I think, it looks like a bug in Hibernate. Don't you think so?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate many-to-many problem
 
Similar Threads
Simple requirement .. but I don't know how!
Simple requirement .. but I don't know how!
Help me for Joinin two tables.
How to map a class that has an object that is defined as @Embeddable
how to update OneToMany