MolgenisValidationException translateReadonlyViolation(PSQLException pSqlException) {
    Matcher matcher =
        Pattern.compile(
                "Updating read-only column \"?(.*?)\"? of table \"?(.*?)\"? with id \\[(.*?)] is not allowed")
            .matcher(pSqlException.getServerErrorMessage().getMessage());
    boolean matches = matcher.matches();
    if (!matches) {
      LOG.error(ERROR_TRANSLATING_POSTGRES_EXC_MSG, pSqlException);
      throw new RuntimeException(ERROR_TRANSLATING_EXCEPTION_MSG, pSqlException);
    }
    String colName = matcher.group(1);
    String tableName = matcher.group(2);
    String id = matcher.group(3);
    ConstraintViolation constraintViolation =
        new ConstraintViolation(
            format(
                "Updating read-only attribute '%s' of entity '%s' with id '%s' is not allowed.",
                tryGetAttributeName(tableName, colName).orElse(TOKEN_UNKNOWN),
                tryGetEntityTypeName(tableName).orElse(TOKEN_UNKNOWN),
                id));
    return new MolgenisValidationException(singleton(constraintViolation));
  }
MolgenisValidationException translateReadonlyViolation ( PSQLException pSqlException ) { Matcher matcher = Pattern . compile ( "Updating read-only column \"?(.*?)\"? of table \"?(.*?)\"? with id \\[(.*?)] is not allowed" ) . matcher ( pSqlException . getServerErrorMessage ( ) . getMessage ( ) ) ; boolean matches = matcher . matches ( ) ; if ( ! matches ) { LOG . error ( ERROR_TRANSLATING_POSTGRES_EXC_MSG , pSqlException ) ; throw new RuntimeException ( ERROR_TRANSLATING_EXCEPTION_MSG , pSqlException ) ; } String colName = matcher . group ( 1 ) ; String tableName = matcher . group ( 2 ) ; String id = matcher . group ( 3 ) ; ConstraintViolation constraintViolation = new ConstraintViolation ( format ( "Updating read-only attribute '%s' of entity '%s' with id '%s' is not allowed." , tryGetAttributeName ( tableName , colName ) . orElse ( TOKEN_UNKNOWN ) , tryGetEntityTypeName ( tableName ) . orElse ( TOKEN_UNKNOWN ) , id ) ) ; return new MolgenisValidationException ( singleton ( constraintViolation ) ) ; }
Package private for testability

@param pSqlException PostgreSQL exception
@return translated validation exception