I am running into the following issue with soft deletion. I had a unique constraint for the name of an entity and the user id that created it. This prevented duplicates well. However, if I deleted an entity and then tried to recreate the same name, it would fail because the soft deleted version was still around.
The solution specified in the manual “4.2.1.4.3 Unique Constraints at Database Level” doesn’t seem to work, at least for hsqldb. I added DELETE_TS to the unique index and it now lets me create duplicates with the same name.
Attached is a project example where this happens. The user id gets set in @PostConstruct.
uniqueConstraint.zip (93.3K)