Reputation: 213
I have database schema with unique column CONSTRAINT CLASSA_FIELD UNIQUE (FIELD)
. I need to update rows in this table, but when I call update/flush I receive java.sql.BatchUpdateException: ORA-00001: unique constraint (DBSCHEMA.IDX_CLASSA_FIELD) violated.
.
I've tried to add updatable = false
annotation, merge(entity)
but neither of them works. Any tip how to update such row?
Upvotes: 0
Views: 696
Reputation: 381
Typically when you have a unique constraint on a database field it means that the value in the field has to be unique against all other values in that field across all rows of the table. So to help answer this I'd suggest you let us know what value you're trying to update the field to. Also "rows" suggests you're trying to update more than one row, possibly w/ the same value. If this is true than that's your problem there.
Upvotes: 1