[odb-users] collection mapping error

c.sell at byterefinery.de c.sell at byterefinery.de
Sun Mar 5 16:37:42 EST 2017


Hello all,

I have a simple std::vector<QImage> collection mapping which is  
controlled by a section. I also have traits implementations for the  
QImage type. The database table generated from the mappings has the  
following columns:

object_id
index
value

with object_id referring back to the main object table.

Now, when I try to update the container, I get an exception stating  
that the object was already persistent. This happens during the first  
insert into the empty collection table, so it cannot be true. Further  
investigation shows that the error is in fact a constraint error,  
caused by the fact that no value is bound to the object_id column.  
Stepping to the ODB generated code shows that indeed values for  
'index' and 'value' are supplied, but not for object_id

What can I do?

regards,
Christian



More information about the odb-users mailing list