comp.lang.ada
 help / color / mirror / Atom feed
* GNATColl ORM problem (foreign key twins)
@ 2013-10-30  9:14 Jacob Sparre Andersen
  2013-10-30 12:43 ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Sparre Andersen @ 2013-10-30  9:14 UTC (permalink / raw)


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 <http://repositories.jacob-sparre.dk/gnatcoll-orm-foreign-key-twins>
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-30 17:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox