Hibernate Test 1
In Hibernate, what is Query Level Cache?
Explanation:
Hibernate includes a query resultset cache that works in tandem with the second-level cache.
Is the SessionFactory object thread-safe?
Explanation:
Yes, SessionFactory is thread-safe, and numerous threads can access it at the same time.
What is the meaning of lazy loading?
Explanation:
The term "lazy loading" refers to a strategy in which objects are loaded only when they are needed.
In the hibernate configuration, which of the following statements concerning the hibernate.dialect property is true?
Explanation:
Hibernate generates the necessary SQL for the selected database when this property is set.
Which of the following statements concerning Hibernate's Query object is correct?
Explanation:
Query objects retrieve data from the database and construct objects using SQL or Hibernate Query Language (HQL) strings. A Query instance is used to bind query parameters, limit the number of results returned by a query, and then execute the query.
What is the difference between the session object's save() and persist() methods?
Explanation:
Persist does not return anything after saving the instance, whereas save saves the object and returns the instance's id.
Which of the following statements concerning the @Id annotation is correct?
Explanation:
Hibernate recognizes the @Id annotation on a field and thinks that during runtime, it should be able to access attributes on an object directly through fields.
Which of the following statements about ORM vs. JDBC is correct?
Explanation:
When it comes to ORM vs JDBC, all of the above is true.
When should you utilize a read-only concurrency strategy?
Explanation:
The read-only concurrency method is appropriate for data that does not change. It should only be used as a source of information.