Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate many-to-many problem

 
Alex Kruglov
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, it looks like a bug in Hibernate. Don't you think so?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic