I defined a class B that is derived from class A (single table inheritance in database). In class B an additional property is defined.
Loading a class B with EntityManager.find(A.class, value) returns a instance of type B without problem.
But when using EntityManager.getReference(A.class, value) an error occures when an instance of type B should be loaded: “IllegalArgumentException: object is not an instance of declaring class”. The implementation tries to assign the additional property of B to an instance of A, which is not possible.