AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

primary key in DAO pattern

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
f
Guest





PostPosted: Mon Dec 08, 2003 3:18 pm    Post subject: primary key in DAO pattern Reply with 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
Back to top
Petarian
Guest





PostPosted: Tue Dec 09, 2003 11:19 am    Post subject: Re: primary key in DAO pattern Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.