In Hibernate 4.3 , load()
from session
returns the proxy object with lazy loading and get()
returns the object if it exists or null
if it doesn't. But here and here its mentioned that getReference()
returns a proxy object and load()
returns an object with initialized data.
On Further googling i realized that these methods are from IdentifierLoadAccess Interface. so my questions are
- Is this
getReference()
is functionally equal toload()
from session and thisload()
is equal toget()
fromsession
? - Is this Interface is part of JPA specification? or from Hibernate Native API?
- What is the need for these methods when they have these functionalities are already covered in session interface?