What is the Difference between load() and get()

           
load()
get()
Only use load() method if  u are sure that object exists.
If not sure that object exists then use get().
load() method will throw an exception,if unique id is not found in the database.
get() method will return null if the unique id is not found in the database.
load() method just returns a proxy object by default   and database won't be hit until the proxy is first invoked
get() method hit the database immediately.

0 comments :

Post a Comment