Hibernate / Hibernate interview questions
Different between session.get() and session.load() in Java.
| load() | get() |
| Only use the load() method when the object exists in DB | use get() if you are unsure about the existence of object. |
| load() method throws an exception if the unique identifier could not be found. | get() method returns null if the unique identifier not found in the database |
| load() returns a proxy and will not hit database unil the proxy is invoked to access properties. | get() will hit the database always. |
More Related questions...