Is it possible to check that the fields of an instance of a type respect some sophisticated constraints? (i.e. more complicated than the constraints already available in the Type System)
For example I would like to check that the value of the field MyType.stringField in not in the field MyType.stringsListField. As far as I know, we cannot enforce that with the Type System syntax. What I would like is a member function MyType.validate() to override, in which I would check that my constraint is respected, and that function would be called before upserting the instance.
If I remember correctly, we had callbacks like beforeCreate or beforeUpsert previously, but I do not see them anymore in the documentation of Persistable… (I am using v.7.8.2)
I see that there is a function Obj.validateObj() but if I override it, I will remove the existing validation enforced by the Type System, won’t I?