Hibernate - Java (MCQ) questions and answers

Dear Readers, Welcome to Hibernate multiple choice questions and answers with explanation. These objective type Hibernate questions are very important for campus placement test and job interviews. Specially developed for the Networking freshers and professionals, these model questions are asked in the online technical test and interview of many IT companies.

1)   Hibernate caching improves the performance of the application by pooling the object in the cache.
- Published on 17 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


2)   Which ways are used by the Log4j and Logback frameworks in hibernate framework to support logging?
- Published on 17 Jul 15

a. By log4j.xml file
b. By log4j.properties
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


3)   What does the Session object hold?
- Published on 16 Jul 15

a. First Level Cache
b. Second Level Cache
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: First Level Cache

Explanation:
No explanation is available for this question!


4)   We need to specify @Inheritance(strategy=InheritanceType.JOINED) in the parent class and @PrimaryKeyJoinColumn annotation in the subclasses.
- Published on 15 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


5)   In the elements of Hibernate architecture is a factory of session and client of ConnectionProvider, It holds the second level cache (optional) of data is _____.
- Published on 15 Jul 15

a. Session
b. SessionFactory
c. Transaction
d. ConnectionProvider
Answer  Explanation 

ANSWER: SessionFactory

Explanation:
No explanation is available for this question!


6)   In case of Table per Concrete class, there will be three tables in the database having no relations to each other. Which are the ways to map the table?
- Published on 15 Jul 15

a. By union-subclass element
b. By self-creating the table for each class
c. Both A & B
d. None of the above
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


7)   Abbreviate the term HQL?
- Published on 13 Jul 15

a. Hibernate Queue Language
b. Hibernate Query Language
c. Hipher Query Language
d. None of the above
Answer  Explanation 

ANSWER: Hibernate Query Language

Explanation:
No explanation is available for this question!


8)   Which method is easy for a java programmer to add a criteria?
- Published on 13 Jul 15

a. HCQL
b. HQL
c. SQL
d. None of the above
Answer  Explanation 

ANSWER: HCQL

Explanation:
No explanation is available for this question!


9)   Hibernate is an?
- Published on 13 Jul 15

a. Open Source
b. Lightweight
c. ORM
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


10)   Which of these simplifies an Object Relational Mapping tool?
- Published on 10 Jul 15

a. Data creation
b. Data manipulation
c. Data access
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


1 2