[java] Hibernate - Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1

Few ways I debugged this error:

  1. As suggested in the accepted answer- turn on show sql.
  2. I found there is some issue with setting up the id in the hibernate sql.
  3. Found that I was missing @GeneratedValue(strategy=GenerationType.IDENTITY)