/**
* Tests whether this exception or any nested exception is a
* {@link EntityExistsException}. Unfortunately {@link EJBException}
* sometimes nests cause exception in {@link Throwable#getCause()},
* sometimes in {@link EJBException#getCausedByException()}. Arrrrg.
*/
private boolean isEntityExistsException(final Throwable e) {
if (e == null) {
return false;
}
if (e instanceof PersistenceException) {
return true;
}
if (e instanceof EJBException) {
final EJBException ejbex = (EJBException) e;
if (isEntityExistsException(ejbex.getCausedByException())) {
return true;
}
}
return isEntityExistsException(e.getCause());
}
EventServiceBean.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:oscm
作者:
评论列表
文章目录