Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Composite primary key problem in Entity Bean

 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir,

Suppose i have a table named purchase_order(po_id,item_id,po_date,desc,...)
in this i am assuming that i have a composite primary key (po_id,item_id). Whether this kind of composite primary key the entity bean support. What i am asking is in ejbFindByPrimaryKey method is returning only an object. Whether this is possible or i have to normalize the table.

What is your suggestion.

Thanks
 
Vinay Raj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Composite primary keys are supported in entity beans. You will have to define a class which holds all the attributes of the primary key. For details regarding the rules to be followed in defining such a key refer EJB specifications.
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for kind idea

But sorry sir I don't know where EJB Specification. Can you provide me the exact link and if any examples would be marvalous.

Once again Thanks
 
Vinay Raj
Ranch Hand
Posts: 81
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer link for EJB specifications. A sample JBoss example is available at this link.
Dude you can get this info on google.
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much sir that example is very useful to me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic