Hello, good day. Could you please help me.
I have a table. And 3 fields in it.
id,
name,
surnamename and
surname are Composite key.
Application can
add, delete, update records in this table.
I added 2 fields in this table -
timeCreated, timeDeleted. And when I'll to delete, I need just set
timeDeleted for this record, but not to delete it !
But I have a problem - ConstraintViolationException. Because when I set
timeDeleted I can not to set the same record in this table.
For example:
I added a new record
Quote:
id | name | surname | timeCreated | timeDeleted
1 | Andy | Somethi | 10.10.2010 | null
then I'll delete it. Result:
Quote:
id | name | surname | timeCreated | timeDeleted
1 | Andy | Somethi | 10.10.2010 10:10 | 10.10.2010 10:15
Then, I want to add the same
name and
surname. But I can not, because composite key by name and surname will throw to me
ConstraintViolationException.
How can I resolve this problem ?