EJB design: Designing a entity bean primary key

  1. Designing a entity bean primary key (1 messages)

    Other that being unique, what other rules should be applied to designing a primary key of an EJB entity bean ? Are there any ?

    For example, I read in a newsgroup (???) that the primary key should consist of business related data (although I cannot find this or any newer references).

    Other references, such as Scot Ambler indicate an object identifier should not be business related since it could change. Furthermore, it should not rely on an proprietary generation mechanisms such as RDBMS IDENTITY types.

    If the primary key class is encapsulated, why should this matter anyway ?

    Thanks for any ideas.
  2. Designing a entity bean primary key[ Go to top ]

    The primary key for an Entity Bean should be the same as the underlying table.