getting entity by id allows NULL as param

(at NULL does not return any entity)