According to the JPA spec:
— The EntityNotFoundException is thrown by the persistence provider when an entityreference obtained by getReference is accessed but the entity does not exist.
However, when you access the id field that you passed to the getReference call, no exception is thrown. Is this the correct behavior? From the logs, it doesn't run the SQL if you access the ID, but it runs it if you access any other field.