To expand on what @RysingDragon said:
An entity object represents the loaded, visible object in the world. This is merely a view of the data on the disk. When the entity is unloaded, the object is forgotten. When the entity is killed, the object is forgotten (even if it’s a player). If the entity is a player and they log out, the object is forgotten. Whether the data is still existent or not is irrelevant; a new view will be constructed once the entity is loaded again. To store an entity object directly in a container is a Bad Thing, because it will very easily cause a memory leak. However, a UUID is simply a number and can be stored directly with no worry of leakage, and can be used to obtain the relevant entity.
If you absolutely MUST hold an entity in a map, use