Any query to the same EntityManager (if
JEE also must be in same JTA transaction), will maintain object identity and return the same object for the same row.
You seem to be executing each query in a different EntityManager, (or different JTA transaction), so if you want to have object identity preserved, you need to use the same EntityManager for the entire request.