hibernate lazy loading

Three lazy loading of hibernate

1) Lazy loading of entity objects

2) Lazy loading of collection types

3) Attribute lazy loading

What is lazy loading, the role of lazy loading

  Lazy loading, also called lazy loading, is a mechanism provided by hibernate to improve program efficiency, that is, it will only be created when the data of the object is actually used.

  Hibernate mainly implements lazy loading through the proxy mechanism. Its specific process: When Hibernate obtains the data of a certain object from the database, when it obtains the collection property value of a certain object, or when it obtains another object associated with an object, because the data of the object is not used, hibernate is not a database. Load the real data, but just create a proxy object for the object to represent this object, all properties on this object are default values; only create this real object when you really need to use the object's data, really from the database Load its data so that in some cases, it can improve query efficiency.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324741820&siteId=291194637