I have an en Entity A which is super class for entities B and C, A is annotated with @Inheritance(strategy = InheritanceType.JOINED).
Then another Entity X which has relation to A.
I set x.a with some object of type B, but when I load x, and check type for x.a it is A, and I cannot cast it to B.
I did that a lot of mapping like this before and it was working correctly cannot know what is the problem here.
Also when I do entityManager.find(A.class, id), it also return A although there is an entity B with the same id, it returns B when I run it from Junit test but not when run the application on tomcat server.