Code example for DataException

Methods: getSQL

0
			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);