* Lazy loading when loading an entity, it is not immediately loaded from the database, that is, loaded into memory from the database. When loading an entity, the load is immediately queried from the database, and the class associated with it is queried at the same time.
The rush load will be quick, because it has been loaded for us at the first load. Lazy loading is relatively slow, because it does not perform SQL operations until we need to query the door.
The advantage of lazy loading is that the memory is small, the execution speed is slow, the load is fast and the memory is high.
Hibernate's Get () He load () method is very different at the time of execution,
Executing the Get () method will load all the basic data,
While the load () method will only load the id attribute in lazy loading, all the ID attributes, other non-ID attributes of the operation will not be executed, when we need to query the specific data is not really execute SQL operation, because lazy loading is valid in a session, So today we get an error when we close the session, because hibernate tries to send SQL queries through the current session, but finds that the session is closed so that no session exceptions are made.
We can load the mode into an urgent load or do not close the session.
The difference between lazy loading and rush loading in Hibernate, and the difference between the Get () method and the load () method in Hibernate