ConstraintViolationException is being thrown by hibernate when I use session.saveOrUpdate(Object). Shouldn't the "update" part prevent this excpetion from being thrown?
I have also tried using session.delete(Object) and then session.save(Object) but the same exception is thrown. How would I fix this?
Adding this annotation to the entity solved the issue: