Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can i specify composite primary key in CMP

 
raghu vadranam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we specity in CMP's DD about composite primary key?
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a primary key class and specify in the DD using

<prim-key-class>com.company.EntityBeanPK</prim-key-class>
 
raghu vadranam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Giju George:
Create a primary key class and specify in the DD using

<prim-key-class>com.company.EntityBeanPK</prim-key-class>


my question is how to mention two fields that are part of primay key in DD?
How container knows how to create instance of Entity bean PK class in CMP?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You dont need to specify the attributes in DD, the PK components are defined as instance variable in the PK class.

Nick
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -- I think you just need to be sure that the fields in your compound key class are defined as persistent fields in the actual bean class, and that the compound key class has public accessor methods for those fields.



Cheers,
Kathy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic