BMP attribute in a CMP, possible????

Discussions

EJB design: BMP attribute in a CMP, possible????

  1. BMP attribute in a CMP, possible???? (3 messages)

    Hi,

    My requirement is:

    I have 1 CMP ReportDef which has 2 attributes: RepDefID (String), name (String) and outputFormat (Java.util.LinkedList). RepDefID is the primary key. I want this CMP to refer to 2 tables, say ReportDef and output_format. Their structure is: ReportDef ( RepDefID VARCHAR2(20), name VARCHAR2(200)) and output_format (RepDefID varchar2(20), format varchar2(20)). RepDefID is the primary key in both the tables and it has a foreign key relationship between ReportDef and output_format table using RepDefID. Also, I want a 1-Many relationship between these 2 tables.
    I am using Oracle 8i, Visual Age for Java 3.5.2 and WebSphere 3.5.

    Effectively what I want to achieve is that when I update the CMP attributes, both of my tables get updated.

    Possible Solution:
    I think I will have to override ejbLoad and ejbStore so that I can get the database connection and update the database table for the outputFormat attribute. Looks like a possibility, not sure this will work.

    Please suggest a better solution, if any…….

    Regards,
    Sumit Mishra
    mailto:sumit@cash-tech.com
    http://www.cash-tech.com/

  2. I dont know wether this is a right way to do it.but You can override the ejbCreate() or the ejbPostCreate().Create a Database connection here and insert data in the child tables and then override the ejbLoad() and ejbStore() likewise to handle the child data.
    this works.i have used it.
    Neeraj...
  3. No.
    Make it all BMP.
  4. hi,

    That option is always open...but i want to test out this particular condition.....