[odb-users] Strange crash with composite primary key.
boris at codesynthesis.com
Mon Apr 2 13:22:14 EDT 2012
Davide Anastasia <Davide.Anastasia at qualitycapital.com> writes:
> I am trying to obtain a composite primary key using this snippet:
Support for composite primary keys is only coming in ODB 1.9.0 so in
the meantime you need to use the pre-release for this functionality:
With 1.9.0 you will still have to make a couple of changed to your
code to make it work:
1. Get rid of id() from:
#pragma db object id()
This declares ClipSize as not having object id at all.
2. Move ClipKey out of the ClipSize class. ODB doesn't support class-
scope value type declarations yet.
3. Provide the less-than comparison operator for ClipKey:
bool operator< (const ClipKey&, const ClipKey&);
This is required for session support.
Other than that, your code should work with 1.9.0.a1.
More information about the odb-users