How hibernate delays loading:
When Hibernate is set to a delayed loading policy, an instance of the proxy class is returned after the query:
Proxy features:
1. Hibernate is dynamically generated at runtime. It extends the persistence class. Therefore, all attributes and methods of the persistence class are implemented.ProgramIs transparent (that is, the application cannot see this proxy class)
2. hibernate creates a proxy class instance. It only initializes its OID attribute.
3. When the application accesses the proxy class attributes for the first time, other attributes of the proxy class are initialized. (In addition to accessing the oId attribute, it is not necessary to check the oId in the database because it has already been started .)
The get () method always loads immediately. this is also a difference between get () and load. another difference is that if no results in the database get () return null and load (); an error is returned.