| We are using Spring Data Jpa 1.9.4 and have multiple entity classes that share the same Primary Key class. We are encountering a WrongClassException when we make multiple sequential calls to findAll() on different CrudRepositories. The problem appears to be that the entities are stored in the session by the EntityManager and retrieved by their key only, which may return object of a different entity. Please see the attached code for an example. We were able to work around this issue by manually clearing the EntityManager between each call to findAll(). |