Examples of DuplicateKeyException


Examples of org.apache.struts2.showcase.exception.DuplicateKeyException

    }
    if (object.getId() == null) {
      throw new CreateException("Cannot store object with null id");
    }
    if (get(object.getClass(), object.getId()) != null) {
      throw new DuplicateKeyException("Object with this id already exists.");
    }
    return intStore(object.getClass(), object).getId();
  }
View Full Code Here

Examples of org.apache.struts2.showcase.exception.DuplicateKeyException

        }
        if (object.getId() == null) {
            throw new CreateException("Cannot store object with null id");
        }
        if (get(object.getClass(), object.getId()) != null) {
            throw new DuplicateKeyException("Object with this id already exists.");
        }
        return intStore(object.getClass(), object).getId();
    }
View Full Code Here

Examples of org.apache.struts2.showcase.exception.DuplicateKeyException

    }
    if (object.getId() == null) {
      throw new CreateException("Cannot store object with null id");
    }
    if (get(object.getClass(), object.getId()) != null) {
      throw new DuplicateKeyException("Object with this id already exists.");
    }
    return intStore(object.getClass(), object).getId();
  }
View Full Code Here

Examples of org.apache.struts2.showcase.exception.DuplicateKeyException

        }
        if (object.getId() == null) {
            throw new CreateException("Cannot store object with null id");
        }
        if (get(object.getClass(), object.getId()) != null) {
            throw new DuplicateKeyException("Object with this id already exists.");
        }
        return intStore(object.getClass(), object).getId();
    }
View Full Code Here

Examples of org.springframework.dao.DuplicateKeyException

    }
    if (ex instanceof NonUniqueResultException) {
      return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
    }
    if (ex instanceof NonUniqueObjectException) {
      return new DuplicateKeyException(ex.getMessage(), ex);
    }
    if (ex instanceof PropertyValueException) {
      return new DataIntegrityViolationException(ex.getMessage(), ex);
    }
    if (ex instanceof PersistentObjectException) {
View Full Code Here

Examples of org.springframework.dao.DuplicateKeyException

          logTranslation(task, sql, sqlEx, false);
          return new InvalidResultSetAccessException(task, sql, sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDuplicateKeyCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new DuplicateKeyException(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

Examples of org.springframework.dao.DuplicateKeyException

    }
    if (ex instanceof NonUniqueResultException) {
      return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
    }
    if (ex instanceof NonUniqueObjectException) {
      return new DuplicateKeyException(ex.getMessage(), ex);
    }
    if (ex instanceof PropertyValueException) {
      return new DataIntegrityViolationException(ex.getMessage(), ex);
    }
    if (ex instanceof PersistentObjectException) {
View Full Code Here

Examples of org.springframework.dao.DuplicateKeyException

    }
    if (ex instanceof NonUniqueResultException) {
      return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
    }
    if (ex instanceof NonUniqueObjectException) {
      return new DuplicateKeyException(ex.getMessage(), ex);
    }
    if (ex instanceof PropertyValueException) {
      return new DataIntegrityViolationException(ex.getMessage(), ex);
    }
    if (ex instanceof PersistentObjectException) {
View Full Code Here

Examples of org.springframework.dao.DuplicateKeyException

          logTranslation(task, sql, sqlEx, false);
          return new InvalidResultSetAccessException(task, sql, sqlEx);
        }
        else if (Arrays.binarySearch(this.sqlErrorCodes.getDuplicateKeyCodes(), errorCode) >= 0) {
          logTranslation(task, sql, sqlEx, false);
          return new DuplicateKeyException(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

Examples of org.springframework.dao.DuplicateKeyException

    Iterator<Row> iterator = resultSet.iterator();
    if (iterator.hasNext()) {
      Row row = iterator.next();
      T result = readRowCallback.doWith(row);
      if (iterator.hasNext()) {
        throw new DuplicateKeyException("found two or more results in query " + query);
      }
      return result;
    }

    return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.