title: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
body: <p>Error: org.hibernate.MappingException: Unknown entity: com.myapp.struts.timesheetForm</p>
  
  <p>The above error occurs when attempting to save data from a Bean within an Action class in Struts using the hibernate framework.</p>
  
  <p>The main files:</p>
  
  <pre><code>timeSheet.jsp
  timesheetForm.java
  timeSheetAction.java
  </code></pre>
  
  <p>TimeSheetData.java is my pojo.</p>
  
  <p>Extracting data from the database using hibernate is easy and works like a charm. timeSheet.jsp gets populated perfectly.</p>
  
  <p>My timesheetaction.java is where I plan to save the updated data to the database.</p>
  
  <p>I create a bean object based on the form data.</p>
  
  <p>I create an object based on the timesheetdata.java</p>
  
  <p>I use beanutils to copy the properties of the formbean into the pojo.</p>
  
  <p>then update via the session object.</p>
  
  <p>I have worked out that its null but thats as much as I can work out.</p>
  
  <pre><code>Session sess = HibernateUtil.getSessionFactory().getCurrentSession();
  sess.beginTransaction();
  timesheetForm formBean = (timesheetForm)form;
  timeSheetData formData = new TimeSheetData();
  formBean.setAdditionhours4_1(formBean.getAdditionhours1_1());
  BeanUtils.copyProperties(formData, formBean);
  sess.update(formData);
  sess.getTransaction().commit();
  sess.flush();
  sess.close();
  </code></pre>