wood burning stoves
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

Hibernate many-to-many problem

Alex Kruglov

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

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
It's not a secret anymore!