 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
f Guest
|
Posted: Mon Dec 08, 2003 3:18 pm Post subject: primary key in DAO pattern |
|
|
I am writing a system which is going to be used on different
databases. I use the DAO design pattern. The idea is that my system
focus on business logic only and it is up to the implementation of the
DAO that links my system to different databases with different schema.
My question is how to design the primary key in my system for each
data piece. I think the key is nessary for me when I write this
system, even though I know my system is to used differently, because
sometimes I need to join the data or whatever. And the key needs to be
translated to different databases when DAO is implemented.
DO I need the primary key for my Data? How to design the key so it can
be easily implemented by different database?
THanks,
ff
|
|
| Back to top |
|
 |
Petarian Guest
|
Posted: Tue Dec 09, 2003 11:19 am Post subject: Re: primary key in DAO pattern |
|
|
Hello,
I think that if you use an integer as a primary key, that should work in
an hetrogeneous enviroment. DO NOT use an auto incrementing integer as
some database do not support that.
Another suggestion is to have your clients use a third party tool that
generates the DAO classes. This way you will know how the keys will be
generated. One such tool is DB Architect (http://www.synametrics.com)
Regards,
Pete
f wrote:
| Quote: | I am writing a system which is going to be used on different
databases. I use the DAO design pattern. The idea is that my system
focus on business logic only and it is up to the implementation of the
DAO that links my system to different databases with different schema.
My question is how to design the primary key in my system for each
data piece. I think the key is nessary for me when I write this
system, even though I know my system is to used differently, because
sometimes I need to join the data or whatever. And the key needs to be
translated to different databases when DAO is implemented.
DO I need the primary key for my Data? How to design the key so it can
be easily implemented by different database?
THanks,
ff
|
--
You don't pay to get spam, why pay to clean it?
Visit http://www.spammarshall.com to create an account for free
<http://www.spammarshall.com>
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|