From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: GNATColl ORM problem (foreign key twins) Date: Wed, 30 Oct 2013 10:14:04 +0100 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: <87zjprp1cz.fsf@adaheads.sparre-andersen.dk> NNTP-Posting-Host: fw2.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: loke.gir.dk 1383124444 12482 130.225.212.4 (30 Oct 2013 09:14:04 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 30 Oct 2013 09:14:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:323UkXIi0Glhzl8rpA+UeNgvUDk= Xref: news.eternal-september.org comp.lang.ada:17557 Date: 2013-10-30T10:14:04+01:00 List-Id: I am spending some time studying and experimenting with the GNATColl database interfacing facilities. GNATColl can generate a type-safe database interface from a formal description of the tables, but in some cases it generates un-compilable Ada packages. I want to model a collection of categories and subcategories in a database like this: | TABLE | categories | category | | Item categorisations | | name | Text | PK | | | | TABLE | category_subsets | category_subset | | Item categorisations | | superset | FK categories(name) | NOT NULL | | | | subset | FK categories(name) | NOT NULL | | | But this fails because GNATColl names the foreign key fields with the referenced field name instead of with the referencing field name. See for some of the variations I have tried. Does any of you know enough about GNATColl (specifically "gnatcoll_db2ada") to have an idea about how to fix the problem? (The problem has been reported to AdaCore, but they don't have any customers funding a fix.) Greetings, Jacob -- Photo of the day: http://billeder.sparre-andersen.dk/dagens/