@Test void translateValueTooLongViolation() { ServerErrorMessage serverErrorMessage = mock(ServerErrorMessage.class); when(serverErrorMessage.getMessage()) .thenReturn("ERROR: value too long for type character varying(255)"); ValueLengthExceededException e = postgreSqlExceptionTranslator.translateValueTooLongViolation(mock(Throwable.class)); assertNull(e.getMessage()); }
ValueLengthExceededException translateValueTooLongViolation(Throwable sourceThrowable) { return new ValueLengthExceededException(sourceThrowable); }
PostgreSqlExceptionTranslator extends SQLErrorCodeSQLExceptionTranslator implements TransactionExceptionTranslator { ValueLengthExceededException translateValueTooLongViolation(Throwable sourceThrowable) { return new ValueLengthExceededException(sourceThrowable); } }
PostgreSqlExceptionTranslator extends SQLErrorCodeSQLExceptionTranslator implements TransactionExceptionTranslator { ValueLengthExceededException translateValueTooLongViolation(Throwable sourceThrowable) { return new ValueLengthExceededException(sourceThrowable); } PostgreSqlExceptionTranslator(DataSource dataSource, EntityTypeRegistry entityTypeRegistry); }
PostgreSqlExceptionTranslator extends SQLErrorCodeSQLExceptionTranslator implements TransactionExceptionTranslator { ValueLengthExceededException translateValueTooLongViolation(Throwable sourceThrowable) { return new ValueLengthExceededException(sourceThrowable); } PostgreSqlExceptionTranslator(DataSource dataSource, EntityTypeRegistry entityTypeRegistry); @Override @Nullable @CheckForNull DataAccessException doTranslate(TransactionException transactionException); }
PostgreSqlExceptionTranslator extends SQLErrorCodeSQLExceptionTranslator implements TransactionExceptionTranslator { ValueLengthExceededException translateValueTooLongViolation(Throwable sourceThrowable) { return new ValueLengthExceededException(sourceThrowable); } PostgreSqlExceptionTranslator(DataSource dataSource, EntityTypeRegistry entityTypeRegistry); @Override @Nullable @CheckForNull DataAccessException doTranslate(TransactionException transactionException);  }