See this answer as well, this is actually normal behaviour. The first dao.get(1) retrieves an entity with database key 1 and attaches is to the session.
When the second dao.get(1) is executed, the session is still opened so Hibernate will not query the database again, but will return the reference that it already has attached to the session instead.
From the perspective of Hibernate there can only be one database object for this table with key 1, and it already holds a reference to the latest in-memory version of it, so Hibernate might as well return it and spare one query.
In order to compare a persistent object in-memory with it's database version, one way is to load the object first and do the comparison before calling the setter on the object.
Another way is to first detach the object from the session with session.evict() and then load the object from the database.
That will ensure that the database version of the data get's loaded into the session. Then comparisons can be made between the evicted object which is now detached and the newly loaded object.
If you wan't to replace the database version with the newer data then call session.merge() on the evicted object.