This excellent question and answer define when to use EntityManager#find
v. #getReference
with this answer.
This question elaborates on the behavior of getting, and then updating an object.
But, I'm only interested in determining whether my javax.persistence.Entity
exists for a particular id.
Is EntityManager#getReference
more efficient than EntityManager#find
?
I'm looking for the light-weight way to find whether an id
exists for a given Entity.