title: How can I update specific fields in database by Hibernate?
body: <p>The code below updates all fields of object. How can I update specific fields in a similar way?</p>
  
  <pre><code>public void update() {
      Session session = sessionFactory.openSession();
      Transaction transaction = session.getTransaction();
      transaction.begin();
      for (Object object : currentPager.getList()) {
          Book book = (Book)object;
          if (book.isEdit()){
              session.update(book);
          }
      }
      transaction.commit();
      session.flush();
      session.close();
  }
  </code></pre>