• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create Entity Bean without a Primary Key class

 
Mainak Das
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to create a CMP Entity Bean for an existing table which does not have a primary key. In other words can we have a CMP Entity Bean which does not have a Primary Key class. If it is possible then what should the ejbCreate method of the Entity Bean Class return.
However, I was able to create and deploy in Weblogic 8.1 a CMP Entity Bean for an existing table which had a primary key. And in this case the return type of ejbCreate method was the Primary Key Class which I had created for this Entity Bean
Mainak Das
dmainak@rediffmail.com
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mainak
Well, I wonder if you don't have PK for a table what kind of data is it? If you have stored something in RDBMS then it means it is related with something in "some" way...Either its a weak entity, strong entity , foreign key relation, something...even if something is just data there has to be some sort of uniqueness right? because otherwise how would we differentiate them even by looking at "select * from .." sort of query?
Please let us know why you want to have table without PK?
Regards
Maulin
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean if you have a dependent data (via foreign key relation or something) then you would have that data in some other Entity bean as a entity member rather than entity bean on its own...
Regards
Maulin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic