I have an Aqueduct project using the ORM, with a data model as follows:
class _Thing {
@primaryKey
int id;
String first;
String second;
}
class Thing extends ManagedObject<_Thing> implements _Thing {
@Serialize()
OtherThing get firstAndSecond() {
// return some value computed from first and second
}
@Serialize()
set firstAndSecond(OtherThing firstAndSecond) {
// set first and second based on some computation
}
}
According to the docs for transient properties, annotating with @Serialize()
should enable this model to be serialized/deserialized. It also says that properties in ManagedObject
s are not persisted, but when I run the server, I get the error:
Data Model Error: Property 'firstAndSecond' on 'Thing' has an unsupported type.
If I remove the @Serialize()
, it doesn't try to persist it, but I can't serialize/deserialize this object.
Any suggestions as to why this is happening or how I can control this behaviour?