Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does Hydrate support lazy loading?

hydrate lazy loading support
0
10 Posted

Does Hydrate support lazy loading?

0
10

Lazy loading is a technique in reading objects from a relational database in which objects references are not fully instantiated into objects until they are actually used by the application code. Lazy loading has typically been implemented as a way of avoiding the performance problems associated with reading one-to-many mappings from databases in which a sub-query must be executed for each new object read from the database. Hydrate does not suffer from this problem and lets you choose on an attribute by attribute basis how much or how little of each object you load in a query. You can write a handler to respond to an attribute that has not been loaded being accessed, if you like, but you are almost always better off going back to the original query that populated the object and filling the attribute in there.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.