Best code examples for Hibernate ORM DataException class (org.hibernate.exception.DataException)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM DataException class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM DataException examples from Open Source projects
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);
Full Snippet Info
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); 
Full Snippet Info
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) {
    }; 
Full Snippet Info
4
CodeRank