URGENT !!! - Paging implementation in entity bean

Discussions

EJB design: URGENT !!! - Paging implementation in entity bean

  1. URGENT !!! - Paging implementation in entity bean (5 messages)

    Hi !
    Can I implement paging in entity bean by passing the start pk value as the parameter to the finder method that returns enumeration. Because, the system I develop retrieves multiple records almost around 500 records. So if I implement paging in JSP, when the user clicks "Next" or "Previous", then the bean fetches the full 500 records again for each click and in the JSP I show the next or previous 10 records. By any way, can the database fetch itself be reduced to 10 and a pointer kind of a flag that points the next or previous start pk. Please give me a solution as it needs urgently.

    Thanx
    AJP
  2. I would think that is a resonable solution.

    Dave Wolf
    Internet Applications Division
    Sybase
  3. Hi !
    Can u give me a sample query (in Oracle) that fetches just 10 records at any point of time but it should move to the next 10 or previous 10 records dynamically by keeping some pointer kind of a variable.

    Thanx
    AJP
  4. I have an alternate solution for this. If you are planning to use Entity bean then you have another stateful bean which collect the value and populate it in the vector as a object and also maintain the index so that it will be very easy you no need to go to backend and you can easily pick it up from vector
    Balaji
  5. Could be implemented as a MVC pattern. The controller( session bean) can either have a vector of beans (costly alternative) or a vector of PK.
  6. It may be advantageous to use Session beans that encapsulates an entity bean.

    Windowing Session bean1 calls a Session Bean2 with Primary
    Keys. Session Bean2 calls Entity beans as and when required.

    Ajeet Koru