Hibernate Mock Test III
Hibernate Mock Test III
This section presents you various set of Mock Tests related to Hibernate Framework. You can
download these sample mock tests at your local machine and solve offline at your convenience.
Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
A - <many-to-one>
B - <many-one>
C - <ManyToOne>
A - <one-to-many>
B - <one-many>
C - <OneToMany>
A - <many-to-many>
B - <many-many>
C - <ManyToMany>
B - <one-many>
C - <OneToMany>
A - An employee can have multiple certificates and same certificate can be conferred to many
employees.
Q 6 - What is the difference between save and persist methods of session object?
A - There is no difference.
B - save saves the object and returns status whereas persist stores status in different variable.
C - save saves the object and returns the id of the instance whereas persist do not return
anything after saving the instance.
Q 7 - What is the difference between get and load methods of session object?
B - get always hits the database whereas load method doesn't hit the database.
A - true
B - false
Q 10 - Child objects are not loaded when parent is loaded/populated from database.
What this technique is called?
A - Eager Loading
B - Lazy Loading
A - HQL takes java objects in the same way as SQL takes tables.
B - The first-level cache is a mandatory cache through which all requests must pass.
C - The Session object keeps an object under its own power before committing it to the database.
A - The second-level cache is the SessionFactory based cache and is mainly responsible for
caching objects across sessions.
C - The second-level cache is mainly responsible for caching objects across sessions.
A - true
B - false
A - true
B - false
A - true
B - false
A - The query-level cache is cache for query resultsets that integrates closely with the second-
level cache.
B - Query level cache requires two additional physical cache regions that hold the cached query
results and the timestamps when a table was last updated.
C - Query level cache is only useful for queries that are run frequently with the same parameters.
B - Read-write
C - Nonstrict-read-write.
B - Use this strategy for read-mostly data where it is critical to prevent stale data in concurrent
transactions.
C - Use this strategy if data hardly ever changes and a small likelihood of stale data is not of
critical concern.
B - Use this strategy for read-mostly data where it is critical to prevent stale data in concurrent
transactions.
C - Use this strategy if data hardly ever changes and a small likelihood of stale data is not of
critical concern.
B - Use this strategy for read-mostly data where it is critical to prevent stale data in concurrent
transactions.
C - Use this strategy if data hardly ever changes and a small likelihood of stale data is not of
critical concern.
ANSWER SHEET
1 A
2 A
3 A
4 A
5 A
6 C
7 D
8 A
9 A
10 B
11 A
12 D
13 A
14 D
15 A
16 D
17 A
18 B
19 B
20 A
21 D
22 D
23 B
24 B
25 C
Loading [MathJax]/jax/output/HTML-CSS/jax.js