• 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

how can i specify composite primary key in CMP

 
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?
 
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?
 
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
 
Cowgirl and Author
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
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic