[odb-users] odb persistence in a library / cross-model dependencies

Boris Kolpackov boris at codesynthesis.com
Fri Oct 2 10:32:22 EDT 2015


Hi Christian,

Christian Sell <christian at gsvitec.com> writes:

> My Question: are cross-model references really unsupported or did I miss
> something?

What exactly does "cross-model references" mean, anyway?

If you think about it, ODB schema evolution support is not that involved
(and we would like to keep it that way):

1. ODB will keep track of the schema version in a special table.
2. ODB will automatically generate schema migration SQL from version
   to version.
3. ODB will allow you to hook data migration in-between those steps.

As an extra, you can have several named, independent schema sub-sets
for which all this can be done.

And that's it. Specifically, there is no (and most likely never will
be) any kind of support for hierarchical versions where some changes
from one sub-set are also propagated to another, or some such. Even
thinking about this makes me nauseous ;-).

One thing to keep in mind is that it all boils down to the database
schema. In fact, if you are not generating the schema, then there is
no schema evolution support (the changelog is only maintained if/when
you request database schema generation). And you have a pretty good
control over for which classes the schema is generated.

What this means specifically to your situation is that:

1. If you place the base class in a separate header.
2. Make sure it does not change (i.e., don't version the base).
3. And don't generate its schema in the versioned subset.

Then there is no reason why this won't work.

Boris



More information about the odb-users mailing list