comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <jacob@jacob-sparre.dk>
Subject: Re: GNATColl ORM problem (foreign key twins)
Date: Wed, 30 Oct 2013 18:48:03 +0100
Date: 2013-10-30T18:48:03+01:00	[thread overview]
Message-ID: <871u32abvw.fsf@adaheads.sparre-andersen.dk> (raw)
In-Reply-To: lysivjrks8.fsf@pushface.org

Simon Wright wrote:

> I think that the problem is that the thing in brackets is not meant to
> be the PK in the table that is being referenced, it's the name of the
> reverse relationship. Look for 'revert_name' under [1] (I'm pretty
> sure this should be 'reverse_name', BTW).

Thanks.  It looks like you are correct.

> | TABLE    | category_subsets     | category_subset |  | Item categorisations |
> | superset | FK categories(parents) | NOT NULL        |  |                    |
> | subset   | FK categories(children) | NOT NULL        |  |                    |

It can be even simpler:

| TABLE    | category_subsets | category_subset |  | Item categorisations |
| superset | FK categories    | NOT NULL        |  |                      |
| subset   | FK categories    | NOT NULL        |  |                      |

> [1] http://docs.adacore.com/gnatcoll-docs/sql.html#database-schema

The formal grammar for foreign keys might be improved by making it
explicit that the reverse_name isn't required.

Once more; thanks for clarifying the documentation for me.

Greetings,

Jacob
-- 
"... while the C compiler will happily generate code for
 almost anything produced by leaning on the keyboard."


      reply	other threads:[~2013-10-30 17:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30  9:14 GNATColl ORM problem (foreign key twins) Jacob Sparre Andersen
2013-10-30 12:43 ` Simon Wright
2013-10-30 17:48   ` Jacob Sparre Andersen [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox