List of usage examples for javax.persistence QueryTimeoutException QueryTimeoutException
public QueryTimeoutException(String message, Throwable cause)
QueryTimeoutException
exception with the specified detail message and cause. 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); }