i’m trying to figure wether there’s a difference betweeen anotating (let’s take @id as an example) a getter method and the concerned field directly , in case i annotate the field , does JPA use some kind of reflection to invok the corresponding getter ?
because in my case i’m trying to obfuscate my entity classes , so i’m looking for a way to keep the business logic since the getters will be renamed into something like aaa() .
i’m trying to figure wether there’s a difference betweeen anotating (let’s take @id as
Share
Here’s what the section 2.3.1 of the JPA2 specification says:
So, if you want to avoid problems with the obfuscation, then annotate the fields and not the getters, consistently, or use the @Access annotation to force field access type.