Search Interview Questions | Click here and help us by providing the answer. Click Correct / Improve and please let us know. |
|
|||
|
| ||||
| Hibernate - Interview Questions and Answers for 'Capgemini' - 4 question(s) found - Order By Newest | ||||
| ||||
| Ans. If id doesnt exist in the DB load throws an exception whereas get returns null in that case.get makes the call to DB immediately whereas load makes the call to proxy. | ||||
| ||||
| Ans. 1. EHCache ( Easy Hibernate ) 2. OSCache ( Open Symphony ) 3. Swarm Cache ( JBoss ) 4. Tree Cache ( JBoss ) | ||||
| ||||
| Ans. Criteria is a simplified API for retrieving entities by composing Criterion objects. For example - session.createCriteria(Employee.class).add( Restrictions.like("name", "A%") ).list(); will return all employee objects having name starting with A. | ||||
| ||||
| Ans. Every fresh session having its own cache memory, Caching is a mechanism for storing the loaded objects into cache memory. The advantage of cache mechanism is, whenever again we want to load the same object from the database then instead of hitting the database once again, it loads from the local cache memory only, so that the no. of round trips between an application and a database server got decreased. It means caching mechanism increases the performance of the application. In hibernate we have two levels of caching First Level Cache [ or ] Session Cache Second Level Cache [ or ] Session Factory Cache [ or ] JVM Level Cache | ||||