Following quiz provides Multiple Choice Questions (MCQs) related to Hibernate Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which of the following is not an ORM framework?
NoSQL is not an ORM framework.
Yes, SessionFactory is a thread-safe and can be accessed by multiple threads simultaneously.
Q 3 - Session.beginTransaction method begins a unit of work and returns the associated Transaction object.
Session.beginTransaction method begins a unit of work and returns the associated Transaction object.
Q 4 - Which of the following is true about <class> element?
The <class> elements are used to define specific mappings from a Java classes to the database tables. The Java class name is specified using the name attribute of the class element and the database table name is specified using the table attribute.
Q 5 - Which element of hbm.xml automatically generate the primary key values?
The <generator> element within the id element is used to automatically generate the primary key values.
Q 6 - What is lazy loading?
Lazy loading is a technique in which objects are loaded on demand basis.
query level cache is an optional cache.
Q 8 - When a Read-only concurrency strategy is to be used?
Read-only concurrency strategy is suitable for data which never changes. Use it for reference data only.
The SessionFactory is heavyweight object so usually it is created during application start up and kept for later use.
Q 10 - nullable attribute of @Column annotation permits the column to be marked NOT NULL when the schema is generated.
nullable attribute of @Column annotation permits the column to be marked NOT NULL when the schema is generated.