• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Primary Key class  RSS feed

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could anyone explain me why the definition of the PK can be deferred until deployment ?
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, that's pretty vague question. I assume you are talking about entity beans? Most deployment tools let you pick an attribute of the bean class as the primary key for the class. This means either no separate PK class is needed, or the deployment can easily generate a PK class for you.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I think Roger is referring to Section 10.8.3 Special case: Unknown primary key class of the EJB Specification.
The benefit of an undefined Primary Key is that is allows the Deployer to map the PK to their specific environment, be it an Object Database or an RDBMS.
This also imposes quite a few limitations on the Bean Provider, most restricting of all is that a PK can not be explicitly created in your code since you don't know what the PK is until deployment time.
[ January 20, 2003: Message edited by: Chris Mathews ]
 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to code for findByPrimaryKey method before PK is defined? please help to understand, thanks
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Object as type of Key in all methods
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!