[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUe] Inverse Master/Detail relations

From: Jason Cater
Subject: Re: [GNUe] Inverse Master/Detail relations
Date: Wed, 17 Aug 2005 16:48:36 -0500
User-agent: KMail/1.8


With our "query-by-detail" support, is there any advantage to reverse 
master/detail now? Simply have the detail block come before the master block 
on the layout page.  The "master" would then be the proper "primary" table 
(relationally speaking), so inserts shouldn't fail. 

Or am I not thinking through this question fully and missing something. 

Also, we have a primarykeyseq="sequencename" attribute on datasources now, so 
the pre-insert trigger is no longer necessary. 

-- Jason 

On Tuesday 16 August 2005 4:46 pm, Andreas Fromm wrote:
> James Thompson wrote:
> > For existing records I don't see any problem using forms standard
> > master/detail. Just still use the customer table as the master.
> > Forms doesn't map master/detail to any type of primary/foreign key
> > relationship in the backend. Instead master/detail simple says if
> > the master changes update the detail blocks to reflect the proper
> > values. So in that case I don't see an issue.
> >
> > Thinking it through I guess new records would cause a problem as I
> > believe the master is always inserted before the details. In these
> > cases you would have to fall back to triggers to populate the key
> > fields prior to committing the data.
> >
> > I *think* something like this should do it if you're using a db
> > that supports sequences.
> >
> > <trigger type="PRE-INSERT" name="fldAddress"><![CDATA[ # Set
> > default value if self.isEmpty():
> > self.autofillBySequence('seq_address_id') ]]></trigger>
> >
> > But I don't have a working form with this logic so it may need a
> > little work to make it happy.
> >
> > Hope this helps, James
> Thank you for your replay. With your suggestion I can insert new
> records now! When I tryed to set the M/D things up, I got some strange
> problems, but I think I did something wrong that time. My problem now
> is that I had to delete the referencing constrain on the column, to
> allaw the master record to be stored before the detail record.
> Can I execute the insertion of the detail record from the trigger, so
> that the referencing constrain can be left in the database?
> Another question about dropdown boxes. Can I set up a dropdown or a
> list box which doesn't offer the a blank entry as an option?
> Regards
> Andreas
> _______________________________________________
> Gnue mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]