I actually am using hibernate to create my data model (I'm actually
pretty experienced at data modeling, the problem is that I'm largely self
taught so I have the occasional glaring blind spot like not knowing the
precise rules of foreign keys :)). 

        The problem is that I told hibernate to use one association table
for all the parent tables which hibernate thinks is legal, but which the
database layer screams bloody murder at. The other problem is that I
prototyped the model in myISAM, which is beyond loosey-goosey in terms of
sql standards, so the "multiple foreign keys on the same row" approach
passed muster there. Now that I'm actually getting closer to rollout I'm
trying to swap in INNODB in back, only it won't accept the create table DDL
because of the FK duplication issue.

        I was hoping somebody had a solution other than "one association
table per mapping" if for no other reason than that'll involve a major
refactor of a lot of mapping files :(.

        Oh well, looks like I've got plans for my thanksgiving weekend now
:).

        Thanks for the suggestions,

        --- Pat

        

> -----Original Message-----
> From: Henri Dupre [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 23, 2005 1:21 PM
> To: Tapestry users
> Subject: Re: OT: Stupid SQL Question
> 
> On 11/23/05, Patrick Casey <[EMAIL PROTECTED]> wrote:
> >
> >
> >             Ok, I admit it, this is probably a stupid question, but I
> can't
> > (curiously) seem to find an answer to this in the SQL spec.
> >
> >
> >
> >             Is it legal for a child table (the n side of a 0..n)
> > relationship to have a foreign key relationship to *more than one*
> parent
> > table?
> 
> I'm not sure if this could help you but if you are used rather writing
> code, you may try to model all your data as Java object and use
> Hibernate + hibernate tools to generate your schema. I think it would
> do a nice job especially concerning all relational stuff.
> SQL is sometimes quite unfriendly.
> 
> Thanks,
> 
> Henri.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to