Saturday, 14 March 2015

Hibernate Interview Questions

1. What is the advantage of Hibernate over jdbc?
2. What is Hibernate?
3. What is ORM ?
4. What does ORM consists of ?
5. What are the ORM levels ?
6. Why do you need ORM tools like hibernate?
7. What Does Hibernate Simplify?
8. What is the main difference between Entity Beans and Hibernate ?
9. What are the Core interfaces and classes of Hibernate framework?
10. What is the general flow of Hibernate communication with RDBMS?
11. What is the need for Hibernate mapping file?
12. What are the important tags of hibernate.cfg.xml?
13. What role does the Session interface play in Hibernate?
14. What role does the SessionFactory interface play in Hibernate?
15. What are the most common ways to specify the Hibernate configuration properties?
16. How do you map Java Objects with Database tables?
17. How do you define sequence generated primary key algorithm in hibernate?
18. What is component mapping in Hibernate?
19. Difference between getCurrentSession() and openSession() in Hibernate ?
20. What are the types of Hibernate instance states ?
21. What are the types of inheritance models in Hibernate?
22. What is Hibernate Query Language (HQL)?
23. What are the ways to express joins in HQL?
24. Transaction with plain JDBC in Hibernate ?
25. What are the general considerations or best practices for defining your Hibernate persistent classes?
26. Difference between session.update() and session.lock() in Hibernate ?
27. What are the Collection types in Hibernate ?
28. What is the difference between sorted and ordered collection in hibernate?
29. What do you mean by Named – SQL query?
30. How do you invoke Stored Procedures?
31. Explain Criteria API
32. What’s the difference between load() and get()?
33. What is the difference between and merge and update ?
34. Define cascade and inverse option in one-many mapping?
35. Define HibernateTemplate?
36. What are the benefits does HibernateTemplate provide?
37. How do you switch between relational databases without code changes?
38. If you want to see the Hibernate generated SQL statements on console, what should we do?
39. What are derived properties?
40. Define cascade and inverse option in one-many mapping?
41. Explain about transaction file?
42. Difference between session.save() , session.saveOrUpdate() and session.persist()?
43. Explain about the id field?
44. What is the use of dynamic-insert and dynamic-update attributes in a class mapping?
45. What is automatic dirty checking?
46. What are Callback interfaces?
47. What is Hibernate proxy?
48. How can Hibernate be configured to access an instance variable directly and not through a setter method ?
49. How can a whole class be mapped as immutable?
50. Explain about transparent persistence of Hibernate?
51. Explain about the dirty checking feature of Hibernate?
52. What is the effect when a transient mapped object is passed onto a Sessions save?
53. Explain about addClass function?
54. Explain about addjar() and addDirectory() methods?
55. What is lazy fetching in Hibernate? With Example .
56. How to Integrate Struts Spring Hibernate ?
57. How to prevent concurrent update in Hibernate?
58. What is version checking in Hibernate ?
59. Explain about the dirty checking feature of Hibernate?
60. What is the effect when a transient mapped object is passed onto a Sessions save?
61. Explain about addClass function?
62. What are managed associations and hibernate associations?
63. What are the different approaches to represent an inheritance hierarchy?
64. What are the different methods of identifying an object?
65. What is Attribute Oriented Programming?
66. What is HQL?
67. What is object/relational mapping metadata?
68. What are POJOs?
69. What should SessionFactory be placed so that it can be easily accessed?
70. What does hibernate.properties file consist of?
71. What is meant by Method chaining?
72. What do you create a SessionFactory?
73. What is the file extension you use for hibernate mapping file?
74. What are different environments to configure hibernate?
75. What are the Extension interfaces that are there in hibernate?
76. What are Extension interfaces?
77. What are Callback interfaces?
78. What the Core interfaces are of hibernate framework?
79. Difference between session.save() , session.saveOrUpdate() and session.persist()? 
80. Q.What is the difference between hibernate and jdbc ? 
81. Q. What is lazy fetching in Hibernate? With Example .
82. Q.what is the advantage of Hibernate over jdbc? 
83. How to Integrate Struts Spring Hibernate ? 
84. How to prevent concurrent update in Hibernate? 
85. How to perevent slate object updatation in Hibernate ? 
86. What is version checking in Hibernate ? 
87. How to handle user think time using hibernate ? 
88. Q.Transaction with plain JDBC in Hibernate ? 
89. Q.What are the general considerations or best practices for defining your Hibernate persistent classes? 
90. Q.Difference between session.update() and session.lock() in Hibernate ? 
91. Q.Difference between getCurrentSession() and openSession() in Hibernate ? 
92. Difference between session.saveOrUpdate() and session.merge()? 
93. Filter in Hibernate with Example? 
94. Q.How does Value replacement in Message Resource Bundle work? 
95. Difference between list() and iterate() i9n Hibernate?
96. Difference between session.load() and session.get() ?
97. Deleting persistent objects 
98. SQL statements execution order. 
99. Difference between session.saveOrUpdate() and session.merge(); 
100. Modifying persistent objects? 
101. SQL Queries In Hibernate.. 
102. Filter in Hibernate 
103. Criteria Query Two Condition 
104. Equal and Not Equal criteria query. 
105. Cascade Save or Update in Hibernate ? 
106. One To Many Bi-directional Relation in Hibernate? 
107. One To Many Mapping Using List ? 
108. Many To Many Relation In Hibernate ? 
109. What does session.refresh() do ? 
110. Difference between session.load() and session.get()?
111. Hibernate setup using .cfg.xml file ? 
112. How to add .hbm.xml file in sessionFactory? 
113. How to get Hibernate statistics ? 
114. How to set 2nd level cache in hibernate with EHCache? 
115. How to get JDBC connections in hibernate? 
116. How will you configure Hibernate? 
117. How to create Session and SessionFactory in Hibernate? 
118. What are the Instance states in Hibernate? 
119. What are the core components in Hibernate ? 
120. What is a Hibernate Session? Can you share a session object between different theads? 
121. addScalar() method in hibernate... 
122. Hibernate session.close does _not_ call session.flush ? 
123. What is the main difference between Entity Beans and Hibernate ? 
124. Difference between session.save() and session.saveOrUpdate()? 
125. How are joins handled using Hinernate. 
126. What is Hibernate proxy? 
127. What is the main advantage of using the hibernate than using the sql ? 
128. how to create primary key using hibernate? 
129. what is the advantage of Hibernate over jdbc? 
130. How to Execute Stored procedure in Hibernate ? 
131. what is lazy fetching in hibernate? 

No comments:

Post a Comment