/** * Convert the given PersistenceBrokerException to an appropriate exception * from the org.springframework.dao hierarchy. In case of a wrapped SQLException, * the SQLExceptionTranslator inherited from the superclass gets applied. * May be overridden in subclasses. * @param ex PersistenceBrokerException that occured * @return the corresponding DataAccessException instance * @see #setExceptionTranslator */ public DataAccessException convertOjbAccessException(PersistenceBrokerException ex) { if (ex.getCause() instanceof PersistenceBrokerException) { return convertOjbAccessException((PersistenceBrokerException) ex.getCause()); } else if (ex.getCause() instanceof SQLException) { return convertJdbcAccessException((SQLException) ex.getCause()); } else { throw new OjbOperationException(ex); } }
/** * Convert the given PersistenceBrokerException to an appropriate exception * from the org.springframework.dao hierarchy. In case of a wrapped SQLException, * the SQLExceptionTranslator inherited from the superclass gets applied. * May be overridden in subclasses. * @param ex PersistenceBrokerException that occured * @return the corresponding DataAccessException instance * @see #setExceptionTranslator */ public DataAccessException convertOjbAccessException(PersistenceBrokerException ex) { if (ex.getCause() instanceof PersistenceBrokerException) { return convertOjbAccessException((PersistenceBrokerException) ex.getCause()); } else if (ex.getCause() instanceof SQLException) { return convertJdbcAccessException((SQLException) ex.getCause()); } else { throw new OjbOperationException(ex); } }
/** * Convert the given PersistenceBrokerException to an appropriate exception * from the org.springframework.dao hierarchy. In case of a wrapped SQLException, * the SQLExceptionTranslator inherited from the superclass gets applied. * May be overridden in subclasses. * @param ex PersistenceBrokerException that occured * @return the corresponding DataAccessException instance * @see #setExceptionTranslator */ public DataAccessException convertOjbAccessException(PersistenceBrokerException ex) { if (ex.getCause() instanceof PersistenceBrokerException) { return convertOjbAccessException((PersistenceBrokerException) ex.getCause()); } else if (ex.getCause() instanceof SQLException) { return convertJdbcAccessException((SQLException) ex.getCause()); } else { throw new OjbOperationException(ex); } }