• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is PrimaryKey class is must in cmp entity bean?

 
Mahesh Malviya
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
There is no primary key field in my database table. Is it must to make a PrimaryKey class in developing cmp entity bean.

Thanks and Regards
Mahesh Malviya
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is a must to have a primary key, Otherwise how will recognize the entity instance.
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am not wrong Primary class is must for al Entity beans not just CMP entity beans.
 
Chris Johnston
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't a primary key a basic part of normalizing tables in a Database anyway? If you have a table with no primary keys, how do you uniquely identify a single row?
 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Primary Key is a must but primary key class is not. You can certainly have a primary key defined as String...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!