The problem happens when:
The 'enableDirtyTracking' options is true and the entity is annotated on getters and the update field has a name with an '_' as a second character.
In the attachment there's a small program that illustrates the problem.
We have an entity (Garanz) with a db field N_RIS. The attribute name is nRis, the getter is getNRis(). If we update just NRis, the DefaultFlushEntityEventListener comes in play and its method dirtyCheck is called:
The problem is that hibernate_getDirtyAttributes() contains nRis, while persister.resolveAttributeIndexes matches it with an EntityMetaModel that has a NRis name (with a capitalized 'N').
Moving annotations from getters to fields is a valid workaorund. Unfortunately sometimes this is not easy to do due to reflection considerations that our application do with the entities.
Setting enableDirtyTracking is another option, and probably we'll choose this one at the moment.
Payara 5.183, Oracle 10, JDK 188.8.131.52, Windows 7
Hibernate: 5.2.14 / 5.3.7