load() just returns a proxy by default and database won’t be hit until the proxy is first invoked.
what does it mean by proxy exactly here ?
load() just returns a proxy by default and database won’t be hit until the proxy is first invoked.
what does it mean by proxy exactly here ?
First of all, Proxy is a design pattern. In sense of Hibernate, it is dynamically subclassing your object at runtime. The proxy object will contain the same methods as your object(that's why you don't realize that you are dealing with a proxy), and as you say the database won’t be hit until the proxy is first invoked.