1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)
 

Recent Questions

!!! Hibernate Frequently Asked Questions !!!

Difference between session.load() and session.get() ?

!!!Answer!!!- From Technical Expert

load() will throw an unrecoverable exception if there is no matching database row.
get() will return null if there is no matching database row.


Cat fritz = (Cat) session.load(Cat.class, "1");

Return the Cat Object with key 1. If there is no Cat Object with key 1 then throw will throw an unrecoverable exception.

If the class is
mapped with a proxy, load() just returns an uninitialized proxy and does not actually hit the database until you
invoke a method of the proxy. This behaviour is very useful if you wish to create an association to an object
without actually loading it from the database. It also allows multiple instances to be loaded as a batch if batchsize
is defined for the class mapping.


Cat fritz = (Cat) session.get(Cat.class, "1");
If you are not certain that a matching row exists, you should use the get() method, which hits the database immediately
and returns null if there is no matching row.

Answered By : null Replied Date : Feb 2 2014
Answer :


Answered By : null Replied Date : Dec 28 2013
Answer :


Answered By : null Replied Date : Dec 7 2013
Answer :


Answered By : null Replied Date : Oct 22 2013
Answer :


Answered By : null Replied Date : Oct 16 2013
Answer :


Answered By : null Replied Date : Feb 16 2014
Answer :


Answered By : null Replied Date : Jul 30 2014
Answer :


Answered By : null Replied Date : Oct 19 2014
Answer :


Answered By : null Replied Date : Nov 3 2014
Answer :


Answered By : null Replied Date : Nov 28 2014
Answer :


Answered By : null Replied Date : Jan 24 2015
Answer :


Answered By : null Replied Date : Jan 31 2015
Answer :


Answered By : null Replied Date : May 22 2015
Answer :


Answered By : null Replied Date : Feb 26 2016
Answer :


Answered By : null Replied Date : Jul 30 2017
Answer :


 

You can also contribute to this answer:

Your Name:
Answer:

 
Ask Question and get answer from Expert.
View Answers List from Expert.

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy