I am using spring with JPA (Hibernate Implementation). I want to do mapping of vendor specific SQL error code to my user defined messages. Spring throws DataAccessException. I am not able to retrieve SQL error code from DataAccessException.
I tried somethink like this:
Spring is providing some SQLErrorCodeTranslator using sql-error-code.xml. but it is working with jdbcTemplate. I want to use jpaTemplate.
Thanks for your reply.
I tried catching dataIntegrityViolationException. But issue is, it gives me message that "can not execute JDBCBatchUpdate". If I have unique constraint on more than two columns and I want to display explanatory message to user then it is very difficult for me to do this.
Can you please let me know how can I handle this situation.