Right now, there is code that prevents using the ReflectionOptimizer for some entities. Specifically, entities that use FIELD access or have a virtual id a.k.a. identifierMapper. I totally understand that we have to opt-out of the optimizer for certain unknown PropertyAccess types in org.hibernate.metamodel.internal.EntityRepresentationStrategyPojoStandard#resolveReflectionOptimizer, but the two that I mentioned so far definitely shouldn’t cause that. I think that the fix might involve setting fields directly in the generated ReflectionOptimizer implementation, whereas right now, we always call setters (org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl.SetPropertyValues). |