|
This newly added behavior will introduce null checks everywhere. We have a code in production something like :
public EntityObject getEntityObject(Long id) {
EntityObject obj = entityManager.find(EntityObject.class, id);
entityManager.detach(obj);
return obj;
}
Now with these changes every call to EntityManager#detach(Object); will have to be wrapped with not null if check.
I understand API should not accept null but this adds extra exception which is not defined JPA standard and breaks existing code.
May this null validation can be revisited again?
|