Hi, I want to print a custom message which include for which table , for whic row an exception is thrown. Exception is thrown by hibernate when I am flushing the session and I am using batch save or update. The stack trace says ConstraintViolationException:'cannot inseert duplicate key into object dbo.table_inst.......' . How can I know for which attribute it violated the unique contraint as I am dealing with many tables hardcoding for each table is not possible. Some tables have nested relationship.
|