Is there any way to find out if an entity was read from the database or not?
This question is related to How to know if a detached JPA entity has already been persisted or not?. But the workaround to check its primary key does not answer my question. It would not work for entities which get their primary keys read from an import file or so.
To extend the question:
How do JPA implementations determine if an entity is to be inserted or updated?