if you look at the code:
Case 1:
Load an entity instance by its identifier value with the entity manager's find() method:
--------------------------------------------------------
Case 2:
In some cases, you don't really want to load the object state, but just having a reference to it (ie a proxy). You can get this reference using the getReference() method. This is especially useful to link a child to its parent wo having to load the parent.
So in the second case the user is trying to persist a object relation so he is only trying to associate these 2 object reference and Hibernate takes care of the rest, so I feel in this case the use of getReference() methods makes sense. But will not work if you want to retrieve the object with its relationship as getReference returns only a proxy.
I am not sure how we can use EntityManager to do eager fetching of the related objects, but thats what you are trying to do.
I think you will need to anotate the entity with something like this...
, it should return the actual object with the find method.
Again Merge() works with detached objects so you to have the real object and not its proxy.