Is it mandatory to write session.update(emploee) while updating record in hibernate
<p>Is it mandatory to write <code>session.update(employee)</code> while updating record in hibernate?</p>

<p>Here is my code.</p>

<pre><code>public void updateEmployee() {

    Session session = HibernateUtil.getSessionFactory().openSession();
    Transaction transaction = null;
    try {
        transaction = session.beginTransaction();
        Employee employee = (Employee)session.get(Employee.class, 113);
        employee.setName("Prakash1");
        employee.setSal(60008);
        //session.update(employee);
        transaction.commit();
        System.out.println("Employee records updated!");
    } catch (HibernateException e) {

        transaction.rollback();

        e.printStackTrace();

    } finally {

        session.close();

    }
}
</code></pre>