Let's say you had a table like this:
id | name
---+---------
1 | foo
2 | bar
There is a uniqueness constraint on the name
column.
How would you set the row with id=2
to foo
, and the row with id=1
to bar
?
I know you could probably just assign temporary names to both then stick in the desired names, but that does not seem like the simplest way.
I am using Hibernate, so any Hibernate-specific tricks would be nice. This seems like a problem that affects all RDBMSes in general though.