Hello,everyone
I'm learning QxOrm ,and I came to a question:
if I remove a class field after version increase ,is there anyway to tell QxOrm to skip this field data when reading back old version's archive ?
or I must contain all field in old version class ?
for example
class Simple
{
int fieldAll ; //all versions class has this field
int fieldOnlyV2; //only version 2 has this field
}
QX_REGISTER_CLASS ... -------> version 2 here
then I use qx::serialization::txt/xml/binary::to_file write a version 2 file
class Simple
{
int fieldAll;
//int fieldOnlyV2 is removed in version 3
double fieldSinceV3;
}
QX_REGISTER_CLASS... ---------> version 3 here
in version 3 impl cpp file,
register_class(QxClass<Simple>& t)
{
t.data(&fieldAll,"fieldAll");
-----what should I write here to tell QxOrm skip a "fieldOnlyV2" field ?----
-----if no code here,read function crash because of wrong data field-----
t.data(&fieldSinceV3,"fieldSinceV3",3);
}
I tried t.data("fieldOnlyV2",2),but it seems that function is used to dynamic add property to QObject only.
Thank you for help.