In response to the forum posting http://www.objectdb.com/database/forum/994 changes were made to the way enhancement treats getters and setters (property accessors), namely there are no longer enhanced additional getters/setters, because the additional methods now use (since about version 2-6-5) this pattern:
Instead of this pattern with a suffix (preserving the method as a setter or getter), prior to version 2-6-5:
Where [accessor_name] typically has a form like getFieldName or setFieldName.
May I just observe that this change massively tripped me up (because I was using the old hidden getter/setter pattern with reflection for various tasks, including for diagnosing whether enhancement has indeed taken place, leading me to the false conclusion recently during tests with objectdb-2.6.9_02.jar that enhancement had NOT taken place when it had).
I see now that it is included under the download Notes at:
- Renamed internal Enhancer hidden methods to non property method names.
This change is a huge GOTCHA, and should be announced somehow via some special channel (if you have such channel one can subscribe to for announcements on such important changes, please advise).
(One could argue that I am supposed to be checking every change announced in every version under the Notes links in download pages, but in this case I was "stuck" on objectdb-2.6.3_04.jar because of other bugs - since confirmed as such by ObjectDB support - and have "jumped" to objectdb-2.6.9_01.jar and objectdb-2.6.9_02.jar, and missed this change.)
But I see now also that the change is NOT just limited to changing the enhanced method pattern, the policy for annotations has also changed !
Previously, any annotations (including custom annotations unrelated to JPA, of which I make heavy use) were "moved" to the ObjectDB "hidden" getter (or setter). I see now (using reflection tests) that any annotations seem now to "remain" with the original accessor.
Q: Can you please confirm that my analysis is correct, and that now the Annotations are on the getters, which are now as far as the outside world is concerned "untouched" ?
For what it's worth, I prefer the new policy, however this has major consequences for my main web app development (broke it), because I was necessarily using reflection on the old getter-style hidden ObjectDB methods, because they were (for better or worse) the annotated ones. I am now going to have to perform a substantial migration in my main web app because of this change (as a side-effect of that fact that the old enhancement approach, which "moved" the annotations, essentially broke the JPA API, one reason I prefer the new non-accessor hidden method approach).
Luckily, most of the cases I can handle as encapsulated policy changes without too much fiddly coding, but it's still a major inconvenience.
As far as I can tell, this change to the annotations policy was not announced under the Download notes for any ObjectDB version.