You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Thomas Dudziak <to...@first.gmd.de> on 2003/03/21 11:18:52 UTC
Multiple primary keys in ojb tables
Hi,
I was playing with the tutorials and with the AutoBuildDb stuff when I got
a complaint from MySQL that a CREATE TABLE statement tries to define
multiple primary columns. After some searching I found that in the file
src/test/org/apache/ojb/repository_internal.xml the tables OJB_HL_SEQ and
OJB_LOCKENTRY both define two primary keys. If I'm not mistaken this is
not allowed by most databases, right ?
Tom
Re: Multiple primary keys in ojb tables
Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
I think that mostly databases allow only one primary key and several unique
keys.
Two type of keys allow references (by foreign keys). So, we can say that
unique keys is a king of primary key (except that Primary keys don't allow
nulls, and unique keys allow one value null).
I expect this explain help...
Best regards,
Edson Richter
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 17/3/2003
Re: Multiple primary keys in ojb tables
Posted by Felipe Ramos <fr...@tissat.es>.
Is very common, and sometimes is mandatory to use more than one primary
key in a table.
This is the first DB I know in which it is not possible.
Thomas Dudziak wrote:
>Hi,
>
>I was playing with the tutorials and with the AutoBuildDb stuff when I got
>a complaint from MySQL that a CREATE TABLE statement tries to define
>multiple primary columns. After some searching I found that in the file
>src/test/org/apache/ojb/repository_internal.xml the tables OJB_HL_SEQ and
>OJB_LOCKENTRY both define two primary keys. If I'm not mistaken this is
>not allowed by most databases, right ?
>
>Tom
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
>
--
------------------------
Felipe Ramos
Tissat SA
C/ Orense 34-9ยช
28020 Madrid
Tel: (+34) 91 4175913
Fax: (+34) 91 4172914
Mail: framos@tissat.es
------------------------