Witam,
Jak zamienić equals tutaj na instanceof:
if (ex != null && ex instanceof PersistenceException) {
PersistenceException e = (PersistenceException) ex;
if (e.getCause() != null) {
Throwable providerException = e.getCause();
if ("org.hibernate.exception.ConstraintViolationException".equals(providerException.getClass().getName())) {
Dzięki wielkie!