Identification of Primary Key in BMP


EJB design: Identification of Primary Key in BMP

  1. Identification of Primary Key in BMP (1 messages)

    Hi All,
        The EJB specs says that for an entity bean, the fully qualified package name of the primary key class is to be specified in the <prim-key-class> element in the ejb-jar.xml. I didn't find any other way to mention the primary key in ejb-jar.xml. Suppose I've two String variables in an entity bean, one of which is it's primary key. In this case how the container will identify which field is actually the primary key. In case of CMP the <primkey-field> is there exactly for this purpose. Though in case of BMP, I don't think it's at all a requirement for the container 'cause the container doesn't generate the database access code,
    still it strikes me. Is this one of the reasons behind the say,-always wrap the primary key with ur own class ?

    Comments will be appriciated
  2. Identification of Primary Key in BMP[ Go to top ]

    You return the Primary key instance in the ejbCreate() which is how the container knows.

    Dave Wolf
    Internet Applications Division