EJB design: Does EJB have to have Primary Key

  1. Does EJB have to have Primary Key (2 messages)

    Hi All,

    Does an EJB have to have a primary key field as in if I am modelling a Table (that does not have a primary key) can I replicate this in an EJB...Reason for asking is that an Entity EJB create should return PK...or is this not the case...


  2. how a primary key mantion when u create a table in database
    if u can mail me please mail me on this add
    vaishali_godha at rediffmail dot com
  3. Does EJB have to have Primary Key[ Go to top ]

    Your EJB primary key does not have to relate to the database primary key in any way, it's just that it usually does.

    You should have a primary key somewhere though.

    If the data you are modelling here is, for example, a time series with no real context and hence no primary key then it's probably not suitable for entity bean.