Package org.springframework.dao

Examples of org.springframework.dao.DataRetrievalFailureException


        } else if (returnType == Identity.class) {
            return new Identity((Number) result);
        } else if (Number.class.isAssignableFrom(returnType)) {
            return result;
        } else {
            throw new DataRetrievalFailureException(
                    "The generated key is not of a supported numeric type. " + "Unable to cast ["
                            + result.getClass().getName() + "] to [" + Number.class.getName() + "]");
        }
    }
View Full Code Here


                    bw.setPropertyValue(pd.getName(), value);
                    if (populatedProperties != null) {
                        populatedProperties.add(pd.getName());
                    }
                } catch (NotWritablePropertyException ex) {
                    throw new DataRetrievalFailureException("Unable to map column " + column
                            + " to property " + pd.getName(), ex);
                }
            } else {
                if (checkColumns) {
                    throw new InvalidDataAccessApiUsageException("Unable to map column '" + column
View Full Code Here

        // Retrieve applicable acl_permission.id
        long permissionId = lookupPermissionId(aclDetailsHolder.getForeignKeyId(),
                recipient.toString());

        if (permissionId == -1) {
            throw new DataRetrievalFailureException(
                "Could not locate existing acl_permission for aclObjectIdentity: "
                + aclObjectIdentity + ", recipient: " + recipient.toString());
        }

        // Change permission
View Full Code Here

        // Lookup the object's main properties from the RDBMS (guaranteed no nulls)
        List objects = objectProperties.execute(aclObjectIdentityString);

        if (objects.size() == 0) {
            throw new DataRetrievalFailureException(
                "aclObjectIdentity not found: " + aclObjectIdentityString);
        }

        // Should only be one record
        return (AclDetailsHolder) objects.get(0);
View Full Code Here

        Element element = null;

        try {
            element = cache.get(userCert);
        } catch (CacheException cacheException) {
            throw new DataRetrievalFailureException("Cache failure: "
                + cacheException.getMessage());
        }

        if (logger.isDebugEnabled()) {
            String subjectDN = "unknown";
View Full Code Here

        Element element = null;

        try {
            element = cache.get(serviceTicket);
        } catch (CacheException cacheException) {
            throw new DataRetrievalFailureException("Cache failure: "
                + cacheException.getMessage());
        }

        if (logger.isDebugEnabled()) {
            logger.debug("Cache hit: " + (element != null)
View Full Code Here

        Element element = null;

        try {
            element = cache.get(aclObjectIdentity);
        } catch (CacheException cacheException) {
            throw new DataRetrievalFailureException("Cache failure: "
                + cacheException.getMessage());
        }

        // Return null if cache element has expired or not found
        if (element == null) {
View Full Code Here

        Element element = null;

        try {
            element = cache.get(username);
        } catch (CacheException cacheException) {
            throw new DataRetrievalFailureException("Cache failure: "
                + cacheException.getMessage());
        }

        if (logger.isDebugEnabled()) {
            logger.debug("Cache hit: " + (element != null) + "; username: "
View Full Code Here

      }
      if (ex instanceof EntryExistsException) {
        return new DuplicateKeyException(ex.getMessage(), ex);
      }
      if (ex instanceof EntryNotFoundException) {
        return new DataRetrievalFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof RegionExistsException) {
        return new DataIntegrityViolationException(ex.getMessage(), ex);
      }
    }
    if (ex instanceof CacheRuntimeException) {
      if (ex instanceof CacheXmlException) {
        return new GemfireSystemException(ex);
      }
      if (ex instanceof CancelException) {
        // all cancellations go wrapped by this exception
        return new GemfireCancellationException((CancelException) ex);
      }
      if (ex instanceof CqClosedException) {
        return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
      }
      if (ex instanceof DiskAccessException) {
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof EntryDestroyedException) {
        return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
      }
      if (ex instanceof FailedSynchronizationException) {
        return new PessimisticLockingFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof IndexMaintenanceException) {
        return new GemfireIndexException((IndexMaintenanceException) ex);
      }
      if (ex instanceof OperationAbortedException) {
        // treat user exceptions first
        if (ex instanceof CacheLoaderException) {
          return new GemfireSystemException(ex);
        }
        if (ex instanceof CacheWriterException) {
          return new GemfireSystemException(ex);
        }
        // the rest are treated as resource failures
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof PartitionedRegionDistributionException) {
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof PartitionedRegionStorageException) {
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof QueryExecutionTimeoutException) {
        return new GemfireQueryException((QueryExecutionTimeoutException) ex);
      }
      if (ex instanceof RegionDestroyedException) {
        return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
      }
      if (ex instanceof com.gemstone.gemfire.admin.RegionNotFoundException) {
        return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
      }
      if (ex instanceof ResourceException) {
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof RoleException) {
        return new GemfireSystemException(ex);
      }
      if (ex instanceof StatisticsDisabledException) {
        return new GemfireSystemException(ex);
      }
      if (ex instanceof SynchronizationCommitConflictException) {
        return new PessimisticLockingFailureException(ex.getMessage(), ex);
      }
    }
    if (ex instanceof CopyException) {
      return new GemfireSystemException(ex);
    }
    if (ex instanceof com.gemstone.gemfire.cache.EntryNotFoundInRegion) {
      return new DataRetrievalFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof FunctionException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof GemFireCacheException) {
View Full Code Here

        catch (Exception e)
        {
            String errorMessage = "Error loading user details for: " + username;
            log.error(errorMessage + " " + e.getMessage());

            throw new DataRetrievalFailureException(errorMessage, e);
        }

        // If user still not found, give up.
        if (person == null)
        {
View Full Code Here

TOP

Related Classes of org.springframework.dao.DataRetrievalFailureException

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.