datanucleus-core icon indicating copy to clipboard operation
datanucleus-core copied to clipboard

Persistent properties : check for overriding only getter or setter but not both

Open andyjefferson opened this issue 7 years ago • 0 comments

If there is an override of a getter for a persistent property this can result in dnCopyField/dnReplaceField calling dnSetXXX but for the current class and that method is not present for that class, just for the superclass. In the case of only overriding the setter then we will get methods dnCopyField/dnProvideField with the incorrect signatures

We should check for the method in the current class, and either throw an exception informing them to override both, or search for the superclass that has the method.

Workaround : override both setter and getter

andyjefferson avatar Aug 27 '17 08:08 andyjefferson