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

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

Hibernate ORM SQLGrammarException examples from Open Source projects
This code example shows how to use the following methods: getSQL
		if (ex instanceof JDBCConnectionException) { 
			return new DataAccessResourceFailureException(ex.getMessage(), ex); 
		} 
		if (ex instanceof SQLGrammarException) { 
			SQLGrammarException jdbcEx = (SQLGrammarException) ex; 
			return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); 
		} 
		if (ex instanceof QueryTimeoutException) { 
			QueryTimeoutException jdbcEx = (QueryTimeoutException) ex; 
			return new org.springframework.dao.QueryTimeoutException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); 
		} 
		if (ex instanceof LockAcquisitionException) { 
			LockAcquisitionException jdbcEx = (LockAcquisitionException) ex; 
			return new CannotAcquireLockException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); 
		} 
		if (ex instanceof PessimisticLockException) { 
			PessimisticLockException jdbcEx = (PessimisticLockException) ex; 
			return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); 
		} 
		if (ex instanceof ConstraintViolationException) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods: getSQL
  public static DataAccessException convertHibernateAccessException(HibernateException ex) {
    if (ex instanceof JDBCConnectionException) { return new DataAccessResourceFailureException(
        ex.getMessage(), ex); }
    if (ex instanceof SQLGrammarException) {
      SQLGrammarException jdbcEx = (SQLGrammarException) ex;
      return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]",
          ex);
    } 
    if (ex instanceof LockAcquisitionException) {
      LockAcquisitionException jdbcEx = (LockAcquisitionException) ex;
      return new CannotAcquireLockException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    } 
    if (ex instanceof ConstraintViolationException) {
      ConstraintViolationException jdbcEx = (ConstraintViolationException) ex;
      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);
Full Snippet Info
4
CodeRank