Example usage for javax.persistence QueryTimeoutException QueryTimeoutException

List of usage examples for javax.persistence QueryTimeoutException QueryTimeoutException

Introduction

In this page you can find the example usage for javax.persistence QueryTimeoutException QueryTimeoutException.

Prototype

public QueryTimeoutException(String message, Throwable cause) 

Source Link

Document

Constructs a new QueryTimeoutException exception with the specified detail message and cause.

Usage

From source file:jef.database.DbUtils.java

/**
 * RuntimeException//from  w  w  w. j a v a 2  s . c o m
 * 
 * @param e
 * @return
 */
public static PersistenceException toRuntimeException(SQLException e) {
    String s = e.getSQLState();
    if (e instanceof SQLIntegrityConstraintViolationException) {
        return new EntityExistsException(e);
    } else if (e instanceof SQLTimeoutException) {
        return new QueryTimeoutException(s, e);
    }
    return new PersistenceException(s, e);
}