My problem is when Hibernate persist record in the MySQL database, the previous record is removed and replaced by the new record.
Here is the
Hibernate Mapping: Account.hbm.xml
and
SQL Statement
Which I used with Hibernate and with the MySQL database. I am not sure why records is being removed and replaced, is this a MySQL problem?
You’re most likely binding or setting the Entity ID.
This makes Hibernate think it’s already saved, and thus update it — overwriting your previous record.