Hibernate ORM DataException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM DataException class.

This code example shows how to use the following methods:getSQL
			return new DataIntegrityViolationException(ex.getMessage()  + "; SQL [" + jdbcEx.getSQL() +
					"]; constraint [" + jdbcEx.getConstraintName() + "]", ex);
		} 
		if (ex instanceof DataException) {
			DataException jdbcEx = (DataException) ex;
			return new DataIntegrityViolationException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
		} 
		if (ex instanceof JDBCException) {
			return new HibernateJdbcException((JDBCException) ex);
		} 
		// end of JDBCException (subclass) handling 
 
		if (ex instanceof QueryException) {
			return new HibernateQueryException((QueryException) ex);
		} 
		if (ex instanceof NonUniqueResultException) {
			return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
		} 
		if (ex instanceof NonUniqueObjectException) {
			return new DuplicateKeyException(ex.getMessage(), ex);
7
CodeRank
This code example shows how to use the following methods:getSQL
			return new DataIntegrityViolationException(ex.getMessage()  + "; SQL [" + jdbcEx.getSQL() + 
					"]; constraint [" + jdbcEx.getConstraintName() + "]", ex); 
		} 
		if (ex instanceof DataException) { 
			DataException jdbcEx = (DataException) ex; 
			return new DataIntegrityViolationException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); 
		} 
		if (ex instanceof JDBCException) { 
			return new HibernateJdbcException((JDBCException) ex); 
		} 
		// end of JDBCException (subclass) handling 
 
		if (ex instanceof QueryException) { 
			return new HibernateQueryException((QueryException) ex); 
		} 
		if (ex instanceof NonUniqueResultException) { 
			return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex); 
		} 
		if (ex instanceof NonUniqueObjectException) { 
			return new DuplicateKeyException(ex.getMessage(), ex); 
6
CodeRank
This code example shows how to use the following methods:getSQL
      return new DataIntegrityViolationException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL()
          + "]; constraint [" + jdbcEx.getConstraintName() + "]", ex);
    } 
    if (ex instanceof DataException) {
      DataException jdbcEx = (DataException) ex;
      return new DataIntegrityViolationException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    } 
    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) { return new InvalidDataAccessApiUsageException(
        ex.getMessage(), ex); }
    if (ex instanceof TransientObjectException) { return new InvalidDataAccessApiUsageException(
        ex.getMessage(), ex); }
    if (ex instanceof ObjectDeletedException) { return new InvalidDataAccessApiUsageException(
        ex.getMessage(), ex); }
    return new UncategorizedDataAccessException(ex.getMessage(), ex) {
    }; 
4
CodeRank