| Suggested approach of using
entity = entityManager.getReference(getType(), entity.getId());
|
can't be used because our entity is a generic object, so no
can be invoked unless forcing a specific base class. Using the following approach:
final Object entityId = entityManager.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity); |
entity = entityManager.getReference(getType(), entityId);
|
|