For use case 1 where we have a insert/update causing the ‘duplicate entry’ we can fix it using INSERT INTO ON DUPLICATE KEY
like this
@Entity
@SQLInsert(sql = "INSERT INTO TABLE (ValueUniqueA) VALUES (?) ON DUPLICATE KEY UPDATE ValueUniqueA = VALUES(ValueUniqueA)")
However, use case 2 with 2 updates it is still a problem.