top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Hibernate Proxy and how it helps in lazy loading?

0 votes
591 views
What is Hibernate Proxy and how it helps in lazy loading?
posted Sep 9, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Hibernate uses proxy object to support lazy loading. Basically when you load data from tables, hibernate doesn’t load all the mapped objects. As soon as you reference a child or lookup object via getter methods, if the linked entity is not in the session cache, then the proxy code will go to the database and load the linked object. It uses javassist to effectively and dynamically generate sub-classed implementations of your entity objects.

answer Sep 11, 2017 by Sonali Gupta
...