Hi,
There are two methods available in Hibernate to retrieve the objects from the database:
1. Get Method
2. Load Method
Get method returns null when object is not present in the database and Load method throws an exception.
I am wondering for:
1. What is the benefit of defining these two methods?
2. We could have just one method instead of two and would have handled the scenarios accordingly, so, what is the benefit actucally we are getting by defining two methods?
Thanks,
Vaibhav Garg
There are two methods available in Hibernate to retrieve the objects from the database:
1. Get Method
2. Load Method
Get method returns null when object is not present in the database and Load method throws an exception.
I am wondering for:
1. What is the benefit of defining these two methods?
2. We could have just one method instead of two and would have handled the scenarios accordingly, so, what is the benefit actucally we are getting by defining two methods?
Thanks,
Vaibhav Garg