1 Reply Latest reply on Jan 29, 2002 5:49 PM by Dain Sundstrom

    replacing select with joins to retrieve reporting data

    Noel Rocher Apprentice


      I'm new in EJB 2.0.

      What is the best practice to replace these queries using several tables that return, for example, all data needed to print an invoice.
      I mean with all information about the customer, its addresses for delivery and for the bill, each products, and more ...

      Is the only way is to code this in a session bean using the relationships to find all information ?


        • 1. Re: replacing select with joins to retrieve reporting data
          Dain Sundstrom Master

          I would recomend coding this with a session bean. If it is a lot of data and it needs to be very fast, you may have to go directly to the database, but I would recomend coding the session bean first. This way you can figgure out exactally what data you need and then only if it is not fast enough recode it with direct database access. This will also give you something to test your direct access dabase code against.

          It has always been difficult to access data from lots of tables.

          As a side note, the newest JBossCMP code supports readahead across cmr fields.