• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

How to create Entity Bean without a Primary Key class

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic