Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| |||||||||||
Hibernate - Interview Questions and Answers for 'Tcs' - 8 question(s) found - Order By Newest | |||||||||||
Frequently asked question in companies using Hibernate. | |||||||||||
| |||||||||||
Ans. It's a feature to lazily initialize dependencies , relationship and associations from the Database. Any related references marked as @OneToMany or @ManyToMany are loaded lazily i.e when they are accessed and not when the parent is loaded. | |||||||||||
Sample Code for Lazy Initialization | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   lazy loading hibernate   lazy initialization hibernate   architecture Asked in 77 Companies Basic   frequent | |||||||||||
Try 2 Question(s) Test | |||||||||||
Frequently asked question in companies using hibernate. | |||||||||||
| |||||||||||
Ans. 1. First level cache is enabled by default whereas Second level cache needs to be enabled explicitly. 2. First level Cache came with Hibernate 1.0 whereas Second level cache came with Hibernate 3.0. 3. First level Cache is Session specific whereas Second level cache is shared by sessions that is why First level cache is considered local and second level cache is considered global. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   orm   hibernate cache   architecture   technical lead   first level cache vs second level cache Asked in 18 Companies Intermediate   frequent | |||||||||||
| |||||||||||
Ans. HBM Files ( Mapping ) DB Connection ( DB Connection String , User Name , Password , Pool Size ) SQL Dialect ( SQL variant to be generated ) Show SQL ( Show / No show SQL on Console ) Auto Commit ( True / False ) | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   configuration   barclays Asked in 11 Companies | |||||||||||
Very frequently asked Hibernate interview question. Frequently asked in TCS ( based on 2 feedback ) | |||||||||||
| |||||||||||
Ans. There are 4 types of associations in Hibernate One to One One to Many Many to One Many to Many | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   associations Asked in 11 Companies   frequent | |||||||||||
Very frequently asked if being interviewed for hibernate. Frequently asked in Tata Consultancy (TCS) and Overstock.com | |||||||||||
| |||||||||||
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. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate Asked in 16 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. Lazy fetching is the technique of not loading the child objects when parent objects are loaded. By default Hibernate does not load child objects. One can specify whether to load them or not while doing the association. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   lazy fetching   architecture Asked in 11 Companies   frequent | |||||||||||
Try 2 Question(s) Test | |||||||||||
| |||||||||||
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. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   hibernate criteria Asked in 7 Companies Basic   Frequent | |||||||||||
Try 1 Question(s) Test | |||||||||||
| |||||||||||
This question was recently asked at 'Tata Consultancy (TCS)'.This question is still unanswered. Can you please provide an answer. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate versioning Asked in 1 Companies | |||||||||||
| |||||||||||