• Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity beans and primary keys  RSS feed

 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Everyone,
Can i map Entity Beans(BMP)on tables which don't have primary keys?
Tables without PK'S sounds non sense.But is it possible?
Thanks,
Manjunath
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB Primary key has no actual connection with database keys - it's merely an object that uniquely defines a bean instance. It's common to use a database primary key field, since by definition that ALSO is valid, but there's no absolute requirement. I had a fairly extensive project where there WAS no single database field that uniquely defined a table row, but by combining 2 columns to make the EJB primary key I could map 1 bean to one row.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!