Multiple choice technology web technology

How to get a session object ?

  1. SessionFactory.getSession();

  2. SessionFactory.openSession();

  3. SessionFactory.get();

  4. (session)SessionFactory.getObject();

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To obtain a Session object from SessionFactory, you call the openSession() method. The Session interface is the primary interface for Hibernate persistence operations, used for CRUD operations and queries.