Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!