• Post Reply Bookmark Topic Watch Topic
  • New Topic

HQL help!  RSS feed

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been stuck on this one and am getting lost in information overload

I have 5 tables: A Page has a many-to-many to Header and Header has a many-to-many to Category.

So here are how the tables look: Page -- Page_Header -- Header -- Header_Category -- Category.

I would like to be able to write an HQL query to load all objects for a Page based on the Page Id, so that A single page will have multiple Headers and each Header will have multiple Categories.

I am thinking of using left outer joins but not sure how.. Also maybe using fetching?

Thanks very much!
 
Jinesh Parekh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cant see why do you need an HQL for this. Its as simple as loading the page and initialize the rest of the collections.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!