Christian Pesch wrote:
Could you explain, where the complexity comes from?
The requirement to define foreign keys on the database schema seems
reasonable to me. At least, I've copied the schema definition in my
application
and added foreign key constraints to it.
Maybe one could take some assumptions and eliminate the need for a
manual step
in a simple setup without redirection tables and inheritance and ...?
The problem comes from the necessity to analyze whether a foreignkey can
be placed safely or not. For instance, you cannot define a foreignkey
constraint upon an indirection table if this table is used by a normal
class descriptor as well. It can get even more complex if you have
inheritance for one end of the collection, say via super-references
(which is only implicit in the repository).
Implementing this analysis therefore requires determining what cases can
possibly arise and then quite some implementation work (esp. unit tests).
Tom