@Test void testExplicitResolver_integrityConstraintViolated() { SQLStateResolver resolver = new SQLStateResolver("23505"); boolean isDuplicateKey = resolver.isDuplicateKeyViolation(integrityContraintViolation()); assertFalse(isDuplicateKey, "A general state code should not be matched by the explicitly configured resolver"); }
@Override public boolean isDuplicateKeyViolation(Exception exception) { return findException(exception, SQLException.class).filter(e -> e.getSQLState() != null) .map(e -> e.getSQLState().startsWith(checkCode)).orElse(false); }
SQLStateResolver implements org.axonframework.common.jdbc.PersistenceExceptionResolver { @Override public boolean isDuplicateKeyViolation(Exception exception) { return findException(exception, SQLException.class).filter(e -> e.getSQLState() != null) .map(e -> e.getSQLState().startsWith(checkCode)).orElse(false); } }
SQLStateResolver implements org.axonframework.common.jdbc.PersistenceExceptionResolver { @Override public boolean isDuplicateKeyViolation(Exception exception) { return findException(exception, SQLException.class).filter(e -> e.getSQLState() != null) .map(e -> e.getSQLState().startsWith(checkCode)).orElse(false); } SQLStateResolver();  SQLStateResolver(String checkState); }
SQLStateResolver implements org.axonframework.common.jdbc.PersistenceExceptionResolver { @Override public boolean isDuplicateKeyViolation(Exception exception) { return findException(exception, SQLException.class).filter(e -> e.getSQLState() != null) .map(e -> e.getSQLState().startsWith(checkCode)).orElse(false); } SQLStateResolver();  SQLStateResolver(String checkState); @Override boolean isDuplicateKeyViolation(Exception exception); }
SQLStateResolver implements org.axonframework.common.jdbc.PersistenceExceptionResolver { @Override public boolean isDuplicateKeyViolation(Exception exception) { return findException(exception, SQLException.class).filter(e -> e.getSQLState() != null) .map(e -> e.getSQLState().startsWith(checkCode)).orElse(false); } SQLStateResolver();  SQLStateResolver(String checkState); @Override boolean isDuplicateKeyViolation(Exception exception);  }