| The mapping APIs don’t allow to explicitly specify the access type, users are forced to use the default access type. Even for the annotation mapping, we currently use Hibernate ORM's access type, regardless of where the annotation was found (field or method). Regarding the programmatic mapping API Initially, I chose to not expose such a switch between field and method access types in programmatic mapping APIs because I wanted these APIs to also work in the case of JSON mapping, for instance. But we gave up on that (most notably in bridges), so maybe we could just reintroduce the enum we had in Search 5? It would not make much sense in the case of the Javabean mapping, and would not be very extensible, but I suppose it's not likely we ever need to extend this. Regarding the annotation mapping API Perhaps we should offer a global option (either access the element the annotation was found on, or use ORM's default access type)? |