[odb-users] Update the id of an object which has a relation with
the other object
Boris Kolpackov
boris at codesynthesis.com
Tue Apr 19 10:23:19 EDT 2016
Hi Ali,
> I want to update the id of an object which has a relation with the
> other object.
Sounds like a job for ON UPDATE CASCADE. I think this should work:
#pragma db value_options("ON UPDATE CASCADE")
QList<std::shared_ptr<OTHER_CLASS>> m_otherClassList;
Or, if you had a pointer instead of a container of pointers:
#pragma db options("ON UPDATE CASCADE")
std::shared_ptr<OTHER_CLASS> m_otherClass;
Boris
More information about the odb-users
mailing list