What is the difference between EntityManager.find() and EntityManger.getReference()?
JPA has the concept of an EntityManager, as you know. During your work in the entity manager some objects are loaded from the database, can be modified and afterwards flushed to the database. find() has to return an initialized instance of your object. If it is not already loaded in the EntityManager, it is retrieved … Read more