Package org.springframework.dao

Examples of org.springframework.dao.DataRetrievalFailureException


      Object result = tt.execute(new TransactionCallback() {
        public Object doInTransaction(TransactionStatus status) {
          assertTrue("Has thread connection", TransactionSynchronizationManager.hasResource(connectionFactory));
          CciTemplate ct = new CciTemplate(connectionFactory);
          ct.execute(interactionSpec, record, record);
          throw new DataRetrievalFailureException("error");
        }
      });
    }
    catch (Exception ex) {
    }
View Full Code Here


   */
  public int getNextId(String name) throws DataAccessException {
    Sequence sequence = new Sequence(name, -1);
    sequence = (Sequence) getSqlMapClientTemplate().queryForObject("getSequence", sequence);
    if (sequence == null) {
      throw new DataRetrievalFailureException(
          "Could not get next value of sequence '" + name + "': sequence does not exist");
    }
    Object parameterObject = new Sequence(name, sequence.getNextId() + 1);
    getSqlMapClientTemplate().update("updateSequence", parameterObject, 1);
    return sequence.getNextId();
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) {
            if (logger.isDebugEnabled()) {
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

        // 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
        aclPermissionUpdate.update(new Long(permissionId), newMask);
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(username);
        } catch (CacheException cacheException) {
            throw new DataRetrievalFailureException("Cache failure: " + cacheException.getMessage());
        }

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

      }

      grantedAuthorities = getGrantedAuthority(user);

    } catch (final NumberFormatException e) {
      throw new DataRetrievalFailureException("Cannot loadUserByUsername userId:" + userId + " Exception:" + e.getMessage(), e);
    }

    // Create the UserDetails object for a specified user with
    // their grantedAuthorities List.
    final UserDetails userDetails = new UserImpl(user, grantedAuthorities);
View Full Code Here

    for (int i = 0; i < length; i++) {
      Iterator<Object> keyIter = generatedKeys.get(i).values().iterator();
      if (keyIter.hasNext()) {
        Object key = keyIter.next();
        if (!(key instanceof Number)) {
          throw new DataRetrievalFailureException("The generated key is not of a supported numeric type. " + "Unable to cast ["
              + (key != null ? key.getClass().getName() : null) + "] to [" + Number.class.getName() + "]");
        }
        keys.add((T) key);
      }
    }
View Full Code Here

  protected T _uniqueResult( List<T> results, String uniqueReason ) {
    if ( results == null || results.size() == 0 ) {
      return null;
    }
    if ( results.size() > 1 ) {
      throw new DataRetrievalFailureException( "Multiple instances found with " + uniqueReason );
    }
    return results.get(0);
  }
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.