I have a simple test, where I am trying to update the object, but merge seems to be performing an insert instead of update.
@RunWith(SpringJUnit4ClassRunner.cla
Merge will update the row ONLY IF it founds the id in the database, so if you create a new object and forgot to set its ID to the same ID of the desired row, it will try to insert a new one. In case your database table doesn't have any unique field, probably this insert will be successful as there will be no sql error.
I was able to update the desired row once I set the new object with the ID of that row.