title: How to update a single cell using hibernate
body: <p>This is my code. I am doing a many to many relation between two objects a product and transaction. But when I inserted the updated stock and the transcations in their respected tables. The row in the product which I try to update the stock of becomes all null. This is the update logic</p>
  
  <pre><code>session = NewHibernateUtil.getSessionFactory().getCurrentSession();
  session.beginTransaction();
  SQLQuery sql = session.createSQLQuery("update Inventory set inventoryqty="+e+
      "where inventoryid='"+
      Integer.parseInt(mf.getMf().getSellingForm().getItemBox().getSelectedItem().toString())+
      "'");
  sql.executeUpdate();
  session.getTransaction().commit();
  </code></pre>