3 Replies Latest reply on Aug 6, 2007 11:14 AM by J-C jc

    Best Practice Pagination with OneToMany Mapping

    christian grobmeier Newbie

      hi there,

      a LinkRubric has many Links.

      Its mapped like this:

      @OneToMany(cascade = { CascadeType.ALL },
       fetch = FetchType.LAZY, mappedBy="linkRubric")
      


      i can get out a LinkRubric with that statment:

      SELECT p
      FROM LinkRubric p
      WHERE p.topRubricID = '5'
      


      I put "Lazy Loading" to on, so my links are loaded when this object is beeing accessed. However, i don't want to load all that links at once. My cleint gives me the page and the max_links_per_page params, and i want to limit the size of the links.

      Does anyone have an idea about how to realize this?
      thanks,
      chris