[odb-users] Access relationships

Marcel Nehring mne at qosmotec.com
Mon May 4 06:13:06 EDT 2015


in my code I use the "Unit Of Work"-Pattern. I am currently trying to solve the problem of figuring out in which order I need to persist new objects to avoid foreign key constraint violations.
As a first step I thought on doing a topological sort based on foreign key relationships between persistent classes and I was wondering if ODB provides some kind of information in a way that I could use to perform the sorting?
In some way ODB needs to be aware of existing relationships and I was wondering whether this knowledge can be exploited or whether it is only present during compilation and later "hardcoded" in the generated files.
I had a look into the generated files and it looks like the latter is the case, but I wanted to be sure. This is *not* a feature request.

Figuring out the correct order for persisting objects seems to be a complicated task and not much information about it can be found online. If anyone on the list has some tips/links I would appreciate it.


More information about the odb-users mailing list