On Tue, 16 Nov 2004 06:11:51 -0800 (PST), Tomas Fulajtar
<fu...@ya...> wrote:
> The problem here is that intermediate table has
> usually no primary key - SQLObject self does not
> create any primary key at creation table time.
> Therefore you are not able to use this table as class.
> That is the reason why it is not possible to use two
> One- to many joins as i tried. Or I am wrong? I think
> in general intermediate table SHOULD not have primary
> key!
As far as I know, the reason why its not usual to declare primary keys
for a intermediate table is that, in most situations, such table is
not used to store any data besides the keys needed for the
relationship itself. If you start putting data into it (as it is in
your case), then I assume that you should declare it like a normal
table; in practical terms, declaring a PK should not be a big deal.
You may lose some convenience, but you can model the data correctly.
(btw, I think that there is a way to declare that the PK of the
intermediate table is a combination of two fields. I don't know if it
will work if both fields are FKs though.)
--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: car...@gm...
mail: car...@ya...
|