Hibernate:What is Hibernate proxy?



Share on Google+Share on Google+

ratna rathor
Hibernate:What is Hibernate proxy?
1 Answer(s)      5 years and 3 months ago
Posted in : Hibernate Interview Questions

What is Hibernate proxy?

View Answers

June 23, 2012 at 4:39 PM

Proxy means the authority to represent someone else In hibernate, you can map classes into proxy instead of a table. When load is called on session, a proxy is returned. The proxy contains actual method to load the data. The proxy is created by default by Hibernate, for mapping a class to a file. The code to invoke JDBC contained in this class.

The proxy attributes ?

It enables lazy initialisation of persistent instances of the class.

Initially hibernate returns CGLIB proxies that implement the named interface.

Actual persistent object is loaded at the time of proxy invoked.