[odb-users] Best Practice deleting persistent objects
Boris Kolpackov
boris at codesynthesis.com
Thu Apr 3 13:34:16 EDT 2014
Hi Steven,
Steven Côté <steven.cote at gmail.com> writes:
> So in my case it would be something like:
>
> class group;
>
> #pragma db object
> class user
> {
> ...
>
> std::vector<group*> belongs;
> };
>
> #pragma db object
> class group
> {
> ...
>
> #pragma db inverse(belongs)
> std::vector<user*> member;
> };
>
> Is it possible to describe a relationship like that in the pragma language?
You just did. This is a many-to-many relationship with one side
inverse. There is a section in manual on this kind of relationships.
> Otherwise I guess I'm waiting for version 2.4.0.
You only need to wait for 2.4.0 if you want to use the on_delete
clause.
Boris
More information about the odb-users
mailing list