Lazy loading is the default way of associating objects in Hibernate, and lazy loading will first query the object and get the object's ID.
SQL statements are actually written when they are actually being used for data.
Lazy loading is a valid load period when the session is opened, so we must keep the session open when we want to use lazy loading.
Urgent loading is the direct use of SQL statements to access the database, but speed relative to lazy loading faster.
The Get () method emits an SQL statement to the database as soon as it executes.
The load () method is similar to lazy loading and only emits SQL statements if the entity's properties are actually used;
Also, when the database does not have a query, the method returns a Null,load method and runs out of the exception objectnotfoundexception.
The difference between lazy loading in hibernate, get method and load side difference method