Package org.springframework.dao

Examples of org.springframework.dao.PermissionDeniedDataAccessException


      // meta exceptions
      if (ex instanceof AlreadyExistsException || ex instanceof IndexAlreadyExistsException) {
        return new DataIntegrityViolationException(ex.toString(), ex);
      }
      if (ex instanceof ConfigValSecurityException) {
        return new PermissionDeniedDataAccessException(ex.toString(), ex);
      }
      // fallback
      return new InvalidDataAccessResourceUsageException(ex.toString(), ex);
    }
    // unknown
View Full Code Here


          logTranslation(task, sql, sqlExToUse, false);
          return new DataAccessResourceFailureException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getPermissionDeniedCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlExToUse, false);
          return new PermissionDeniedDataAccessException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDataIntegrityViolationCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlExToUse, false);
          return new DataIntegrityViolationException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
View Full Code Here

          logTranslation(task, sql, sqlExToUse, false);
          return new DataAccessResourceFailureException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getPermissionDeniedCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlExToUse, false);
          return new PermissionDeniedDataAccessException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDataIntegrityViolationCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlExToUse, false);
          return new DataIntegrityViolationException(buildMessage(task, sql, sqlExToUse), sqlExToUse);
        }
View Full Code Here

          logTranslation(task, sql, sqlEx, false);
          return new DataIntegrityViolationException(buildMessage(task, sql, sqlEx), sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getPermissionDeniedCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new PermissionDeniedDataAccessException(buildMessage(task, sql, sqlEx), sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDataAccessResourceFailureCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new DataAccessResourceFailureException(buildMessage(task, sql, sqlEx), sqlEx);
        }
View Full Code Here

      }
      else if (ex instanceof SQLIntegrityConstraintViolationException) {
        return new DataIntegrityViolationException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLInvalidAuthorizationSpecException) {
        return new PermissionDeniedDataAccessException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLNonTransientConnectionException) {
        return new DataAccessResourceFailureException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLSyntaxErrorException) {
View Full Code Here

          logTranslation(task, sql, sqlEx, false);
          return new DataAccessResourceFailureException(buildMessage(task, sql, sqlEx), sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getPermissionDeniedCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new PermissionDeniedDataAccessException(buildMessage(task, sql, sqlEx), sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDataIntegrityViolationCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new DataIntegrityViolationException(buildMessage(task, sql, sqlEx), sqlEx);
        }
View Full Code Here

    SQLException dataIntegrityViolationEx2 = SQLExceptionSubclassFactory.newSQLIntegrityConstraintViolationException("", "", 0);
    DataIntegrityViolationException divex2 = (DataIntegrityViolationException) sext.translate("task", "SQL", dataIntegrityViolationEx2);
    assertEquals(dataIntegrityViolationEx2, divex2.getCause());

    SQLException permissionDeniedEx = SQLExceptionSubclassFactory.newSQLInvalidAuthorizationSpecException("", "", 0);
    PermissionDeniedDataAccessException pdaex = (PermissionDeniedDataAccessException) sext.translate("task", "SQL", permissionDeniedEx);
    assertEquals(permissionDeniedEx, pdaex.getCause());

    SQLException dataAccessResourceEx = SQLExceptionSubclassFactory.newSQLNonTransientConnectionException("", "", 0);
    DataAccessResourceFailureException darex = (DataAccessResourceFailureException) sext.translate("task", "SQL", dataAccessResourceEx);
    assertEquals(dataAccessResourceEx, darex.getCause());
View Full Code Here

    SQLException dataIntegrityViolationEx2 = SQLExceptionSubclassFactory.newSQLIntegrityConstraintViolationException("", "", 0);
    DataIntegrityViolationException divex2 = (DataIntegrityViolationException) sext.translate("task", "SQL", dataIntegrityViolationEx2);
    assertEquals(dataIntegrityViolationEx2, divex2.getCause());

    SQLException permissionDeniedEx = SQLExceptionSubclassFactory.newSQLInvalidAuthorizationSpecException("", "", 0);
    PermissionDeniedDataAccessException pdaex = (PermissionDeniedDataAccessException) sext.translate("task", "SQL", permissionDeniedEx);
    assertEquals(permissionDeniedEx, pdaex.getCause());

    SQLException dataAccessResourceEx = SQLExceptionSubclassFactory.newSQLNonTransientConnectionException("", "", 0);
    DataAccessResourceFailureException darex = (DataAccessResourceFailureException) sext.translate("task", "SQL", dataAccessResourceEx);
    assertEquals(dataAccessResourceEx, darex.getCause());
View Full Code Here

          logTranslation(task, sql, sqlEx, false);
          return new DataIntegrityViolationException(buildMessage(task, sql, sqlEx), sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getPermissionDeniedCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new PermissionDeniedDataAccessException(buildMessage(task, sql, sqlEx), sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDataAccessResourceFailureCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new DataAccessResourceFailureException(buildMessage(task, sql, sqlEx), sqlEx);
        }
View Full Code Here

      }
      else if (ex instanceof SQLIntegrityConstraintViolationException) {
        return new DataIntegrityViolationException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLInvalidAuthorizationSpecException) {
        return new PermissionDeniedDataAccessException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLSyntaxErrorException) {
        return new BadSqlGrammarException(task, sql, ex);
      }
      else if (ex instanceof SQLFeatureNotSupportedException) {
View Full Code Here

TOP

Related Classes of org.springframework.dao.PermissionDeniedDataAccessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.