Package org.springframework.dao

Examples of org.springframework.dao.DataIntegrityViolationException


        }

        private void addUniquely(Index<T> index, T state, Object newVal) {
            final T existingState = index.putIfAbsent(state, indexKey, newVal);
            if (existingState == null || existingState.equals(state)) return;
            throw new DataIntegrityViolationException("Unique property "+property+" was to be set to duplicate value "+newVal);
        }
View Full Code Here


        user.setEmail("matt@raibledesigns.com");
        List users;
        users = new ArrayList();

        users.add(user);
        Exception ex = new DataIntegrityViolationException("");
        userDao.expects(once()).method("saveUser").with(same(user))
               .will(throwException(ex));
       
        // run test
        try {
View Full Code Here

    }
    if (ex instanceof OptimisticLockException) {
      return new JpaOptimisticLockingFailureException((OptimisticLockException) ex);
    }
    if (ex instanceof EntityExistsException) {
      return new DataIntegrityViolationException(ex.getMessage(), ex);
    }
    if (ex instanceof TransactionRequiredException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
View Full Code Here

TOP

Related Classes of org.springframework.dao.DataIntegrityViolationException

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.