0 Replies Latest reply on Jan 11, 2002 3:40 PM by curtis

    CMP Bean 2.0 referencing multiple Local CMP Beans

    curtis

      Hi,

      I'm still learning EJB's and in particular 2.0 Entity Beans w/CMP. What I was wondering is if I can have one Entity bean reference multiple local cmp entity beans based upon the primary key of the first bean. Here's an example of what I mean.

      Bean 1 - The bean the client accesses. This bean contains local fields that are relevant to all the local cmp beans (these fields are things such as name, weight, cost, etc.) This bean has a primary key of name.

      Beans 2,3,4 & 5 are all local entity beans that contain specific information about a particular product.

      Now what I would like is for the Bean 1 to reference the proper local bean (2 thru 5) based on the primary key. So that if the name = "vhs" it accesses bean 2. If the name = "dvd" it accesses bean 3. It will then return that view of the proper local cmp bean to the client.

      Sorry if this is a simple quesetion, or too confusing to make any sense :) Would this be better accomplished using BMP model? or something totally different. Any suggestions on how to go about this task are appreciated.

      Thanks,
      Curtis