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 'Abs' - 12 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 | |||||||||||
| |||||||||||
Ans. 1. Query Optimization ( Query Rewriting , Prepared Statements ) 2. Restructuring Indexes. 3. DB Caching Tuning ( if using ORM ) 4. Identifying the problems ( if any ) with the ORM Strategy ( If using ORM ) | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  java   db   database   hibernate   orm   at&t   overstock.com   performance improvement   architecture   technical lead   architect intermediate | |||||||||||
| |||||||||||
Ans. This annotation is added to the auto increment column with the strategy to increment the column value. Usually this is added to the surrogate primary key column and specified with the Database Sequence. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   hibernate annotations   @generatedvalue   database sequence | |||||||||||
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 | |||||||||||
| |||||||||||
Ans. First Annotation will set the Entity name as EMPLOYEES and hence will try to map with the same Table name. The second annotation will make the Entity mapped to table EMPLOYEES irrespective of the Entity Name ( which is class name in this case ). Third Annotations will set the different names for Enitity and Table and will explicitly map them. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   hibernate annotations   entity annotation   table annotation | |||||||||||
| |||||||||||
Ans. Its a specification that guides the implementation of ORM frameworks. Implementations abiding by the specification would mean that one can be replaced with other in an application without much hassle. Only the Features that are added over the specification needs to be taken care of if any such change is made. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  jpa   hibernate   orm   technologies | |||||||||||
| |||||||||||
Ans. The following code returns the list of Employee objects having employee name starting with A and Dept Name ( Department , Employee Mapped ). session.createCriteria(Employee.class,"emp") .createAlias("emp.department", "dept",Criteria.INNER_JOIN) .add( Restrictions.like("name", "A%") ) .add(Restrictions.eq("dept.name","Finance") .list(); | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate   hibernate criteria   hibernate table mapping | |||||||||||
| |||||||||||
Ans. JDBC is a standard Java Api for Database communication whereas Hibernate is an ORM framework that uses JDBC to connect with Database. Hibernate is another layer of object table mapping over JDBC that provide a database independent, object oriented and an efficient way of database communication. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  JDBC  Hibernate  JDBC vs Hibernate Asked in 3 Companies | |||||||||||
| |||||||||||
Ans. JDBC ( Java Database Connectivity ),ODBC (Open Database Connectivity), Hibernate, JPA ( Java Persistence API ), JOOQ,MyBatis | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  database connection  jdbc  ORM  Hibernate Asked in 1 Companies | |||||||||||
| |||||||||||
This question was recently asked at 'Oracle Argentina'.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  jdbc  odbc  hibernate  jdbc vc odbc  jdbc vs hibernate Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. hibernate-orm hibernate-validator hibernate-ogm hibernate-search or you can download hibernate core with all dependencies. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  hibernate jar files   hibernate Asked in 1 Companies | |||||||||||
| |||||||||||
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 | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 23 Companies | |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||
| |||||||||||