i want to throw myself exceptions through spring catch the exception
so i define a DAOException
try {
getHibernateTemplate().save(user);
}
catch (DataAccessException ex) {
if (ex instanceof DataIntegrityViolationException) {
throw new DAOException("Primary?? key exception in which key??");
}
if (ex instanceof DataRetrievalFailureException) {
throw new DAOException("connect exception");
}
}
the question is:
the spring doesn't differentiate "DataIntegrityViolationException" in detailed.
i don't know which key confilcted or if there are more indexes,which index is confilcted or forgein key confilicted?
what can i do??
maginn


Reply With Quote