[odb-users] Strange crash with composite primary key.

Boris Kolpackov boris at codesynthesis.com
Mon Apr 2 13:22:14 EDT 2012


Hi Davide,

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:

http://www.codesynthesis.com/pipermail/odb-users/2012-March/000470.html

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()
   class ClipSize

   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.

Boris



More information about the odb-users mailing list