Hibernate - Interview Questions and Answers for 'Hibernate' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

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.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Rating

   
 Q91. What is the use of @GeneratedValue annotation in Hibernate?Hibernate
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


Related Questions

  What are the different ID generating strategies using @GeneratedValue annotation ?


 Q92. What are some differences between Spring caching and Hibernate caching?Hibernate
Ans. Spring caching makes use of its intercepting capabilities to add caching to method calls. Therefore, the entire object is cached and reused. Hibernate, on the other hand, has more domain-specific knowledge of the Entity being cached and can handle the objects more appropriately.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     spring framework   hibernate   spring cache   hibernate cache


Related Questions

  Difference between first level and second level cache in hibernate ?
  How to configure second level cache in Hibernate ?
 What is the use case for AWS Gateway cached , stored and VTL ?
  What are the the methods to clear cache in Hibernate ?
  What are different types of second level cache ?
  Can we disable first level cache ? What should one do if we don't want an object to be cached ?
 Have you ever faced any problem due to caching?
 Can you please provide an implementation of application level cache ?
 Implement an LRU Cache ?


 Q93. What is Lazy Initialization in Hibernate ?Hibernate
a. Feature to load the dependencies from Cache
b. Feature to load all objects and relationships in advance before they can be used
c. Feature to not load dependencies and relationship in advance and load when required
d. Feature to not load the dependencies and relationships at all

Ans.c. Feature to not load dependencies and relationship in advance and load when required

 Q94. Which of the following is not the benefit of Lazy Initialization in Hibernate ?Hibernate
a. Laod When required provides better performance
b. Object stays lighter
c. Less number of Database calls
d. Less load on Database

Ans.c. Less number of Database calls

 Q95. Which of the following is not true for Hibernate Cache ?Hibernate
a. First level cache is enabled by default
b. First level Cache is Session specific
c. First level cache is considered global
d. First level Cache came with Hibernate 1.0

Ans.c. First level cache is considered global

 Q96. Which of the following is not an Hibernate AnnotationHibernate
a. @Id
b. @JoinTable
c. @ManyToMany
d. @Autowired

Ans.d. @Autowired

 Q97. Which of the following Design pattern has been used with Hibernate Criteria ?Hibernate
a. Filter
b. Prototype
c. Builder
d. Observer

Ans.a. Filter

 Q98. Which of following is not core interface of Hibernate ?Hibernate
a. Session
b. Transaction
c. SessionFactory
d. TransactionFactory

Ans.d. TransactionFactory

 Q99. Which of the following session method is used to disassociate / disconnect all objects from the sessionHibernate
a. Clear
b. Evict
c. Close
d. Merge

Ans.a. Clear

 Q100. Which of the following session method is used to disassociate / disconnect a particular object / entity from the sessionHibernate
a. Clear
b. Evict
c. Close
d. Merge

Ans.b. Evict

 Q101. Which of following is not the resolution for preventing LazyInitializationException?Hibernate
a. Set fetch=FetchType.EAGER for Dependent entity mapping
b. Make sure that we are accessing the dependent objects before closing the session
c. Make sure that we are accessing the dependent objects after closing the session
d. Wrap the complete access within Transaction

Ans.c. Make sure that we are accessing the dependent objects after closing the session

previous 30   

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: