File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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