Kirk wrote:

> The argument is to name it "id" or another name like "client_id".
> I like client_id because then the primary key name matches the
> foreign key in another table.
> My coworker likes just the name id because then he can have a base
> class called getId()

Personally, I always have a column in each table called "id", and then 
if I'm using it as a foreign key in another table, I reference it as, 
e.g., "client_id".

By that I mean I might have a client table:

CLIENT
id integer primary key auto_increment
blah blah other data fields

and then a table that contains, say, documents for that client:

CLIENT_DOCUMENT
id integer primary key auto_increment
client_id integer default 0
blah blah other data

Here, there might be multiple client documents, and each of them will 
contain a client_id value matching the id field of a client record.

$0.02,
Jeff

Attachment: pgpFEQkR6cUvF.pgp
Description: PGP signature

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to