Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it mandatory to configure a primarykey in the deployment descriptor.

 
NareshAnkuskani Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it mandatory to configure a primarykey in the deployment descriptor.

Not all the tables in the database contains a primarykey.

Suppose i have created an entity bean which represents a table that do not have
a primary key.

Now my question is what can i put as a return type of 'ejbCreate' method in the above created entity bean & how do i configure the primarykey in DeploymentDescriptor?
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all you cannot create entity bean without primarykey.Before returning from ejbCreate method you should specify primarykey for entity bean.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prim-key-class in DD is mandatory. Besides, findByPrimaryKey() is mandatory in entity beans. So I don't think you can have an entity bean that doesn't have primary key.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose i have created an entity bean which represents a table that do not have a primary key.

I think that you have a bad design here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic