• 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

primary key

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a Primary key maps to multiple fields in the Entity bean class then how is the <primkey-field> specified in the deployment descriptor.
 
stable boy
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The primkey-field element is not used if the primary key maps to multiple
container-managed fields.
You will use the <prim-key-class> for compound keys.
 
sonali rao
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still confused.
What if there are 3 fields in the database which are of type String and I want to used 2 of the fields as compound primary key.
How will I mention that in the deployment descriptor using <prim-key-class>
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you will make a new class with the two fields as its instance variables and write that class name in the <prim-key-class>
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic