Discussions

EJB design: I need an Entity Bean to work with multiple tables

  1. Hello ,
       Requirement is that an Entity Bean to work with multiple tables.
       Is it possible to write the bean using Container Managed or should i go for bean managed.

    Thanks in Advance
    Bye
    C.Bhaskaran

  2. Correct me if i am wrong.

     I have read CMP Entity beans do not map to multiple tables.

    Regards

  3. I need an Entity Bean to work with multiple tables
    Yes You are Right
    Bye
    C.Bhaskaran
  4. maybe in EJB 2.0 can use Entity Bean to work with multiple talbes.
  5. hi chandra

    can you explain what you mean by working with multiple tables ?
    If you are talking about multiple joins ..none of the appservers have a full fledged cmp.
    they use a 3rd party persistence mgr viz
    CocoBase from Thought Inc
    or
    Toplink from (cant recollect)

    DOnt know if this helps
    Thanks
  6. One option is to use database view and a CMP bean.
  7. Hi,

    There is a catch using views over multiple tables in most databases, we cannot update/insert views, we can just select from them. So i guess view with one CMP may not work.

    u may use BMP(preferably) or a CMP with java objects as references that can have methods like load and save u can call from your bean's callback methods.

    Thanks!
    --RG