On Sun, 12 Feb 2012 16:16:26 +1100
Konrad Zielinski <kzielin...@gmail.com> wrote:

> Hi,
> I'm trying to work out the proper way to setup a master detail
> relationship in a Picolisp database.
> I have a master record with child records where each child record is a
> string and a number. Different master records do not at all care about
> each others details.
> And really The detail records will never be accessed outside the
> context of the master record. They don't need any indexing, or
> independent lookup.
> so is this the way you would do this?
> (class  +Child +Entity)
>  (rel description (+Key +String))
>  (rel rank (+Number))
> (class +Master +Entity)
> (rel children (+List +Link) ord (+Child))
> Also As master records don;t relate to each other I'm a little
> confused as to how I hand the rest of the database together.
> Do I just start it and add objects to it Or do  I need to build a top
> level List of master objects and set this as the first object
> in the database.
> regards
> Konrad

Hmm, isn't this type of relationship covered by the +Ord and +Pos
classes in the example app included in picolisp's sources?

# @app/er.l
(class +Ord +Entity)
(rel nr (+Need +Key +Number))          # Order Number
(rel pos (+List +Joint) ord (+Pos))    # Positions

(class +Pos +Entity)
(rel ord (+Dep +Joint)                 # Order
   pos (+Ord) )

Orders (masters) are keyed by the order number and +Pos "Order Items"
are linked to the order by a +Joint +List. 

UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to