Environment: Java, Hibernate
Lets say i execute two db queries:
pseudocode:
Author au1 = execute_query_1
Author au2 = execute_query_2
and lets assume that the two queries return the same record from the db.
Is it safe to say that the statement:
au1.equals(au2)
will return true ??
Yes, if you execute your queries with the same session. Hibernate will simply take it from cache.