• Post Reply Bookmark Topic Watch Topic
  • New Topic

primary key generation

 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
- how do you guys handle/create PKs for entityBeans?
- how can i create PKs in a generic way (eg. do not rely on an oracle sequence).
- or how can i create PKs in a generic way such as only one class has to be rewritten if DB changes (eg. a OraclePKGenerator, MySQLPKGenerator...)

thanks a lot for any hint, code or links.
k
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hi all
- how do you guys handle/create PKs for entityBeans?

I let the container/RDBMS take care of it for me. Resin EE and WebLogic have ways of handeling autokey generation through the rdbms.
What app server are you using?
Are you using CMP 2.0?
I've posted some info on how to get id generation to work with WebLogic, and Resin EE support is almost transparent... it is really groovey.

- how can i create PKs in a generic way (eg. do not rely on an oracle sequence).

There are several ways to do this. Have you read EJB Design Patterns by Floyd M.?


- or how can i create PKs in a generic way such as only one class has to be rewritten if DB changes (eg. a OraclePKGenerator, MySQLPKGenerator...)
thanks a lot for any hint, code or links

This link has some information.
The Server Side

Here are a bunch of links on the topic
google search
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rick
thanks for your answers.
It was more some kind of theoretical question.
I was just wondering how to do it. I only played around with the Sun Reference Implementation...

karl
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!