posted 9 years ago
I have a basic question about Hibernate load and get methods
I just wrote a simple Hibernate standalone application.
One table, one class, and one hbm file mapping them. Then I wrote a simple piece of Java/hibernate code to retrieve one record
What I had understood is that if we are sure that object/record is available in memory we should use the load method, or use get if one is not sure, and get will hit DB and get the record
Now since this is a standalone application, I though load would break, after all I have just started the application, memory must be empty, and load method should throw an exception, but to my surprise it worked fine, and record was retrieved, the sysout displayed the correct value. What am I missing?