List of usage examples for org.hibernate.exception DataException getSQLException
public SQLException getSQLException()
From source file:com.lp.server.util.Facade.java
License:Open Source License
final protected void throwEJBExceptionLPforPersistence(PersistenceException peI) throws EJBExceptionLP { EJBExceptionLP en = new EJBExceptionLP(EJBExceptionLP.FEHLER_SQL_EXCEPTION_MIT_INFO, "Eine Persistence Exception ist aufgetreten. Infos erhalten Sie in der SQLException"); if ((Throwable) peI.getCause() instanceof DataException) { DataException ed = (DataException) peI.getCause(); ArrayList<Object> alInfo = new ArrayList<Object>(); alInfo.add(ed.getSQLException().getMessage().toString()); alInfo.add(ed.getSQLException().getNextException().getMessage().toString()); en.setAlInfoForTheClient(alInfo); } else {//from w w w . j ava2 s .c o m ArrayList<Object> alInfo = new ArrayList<Object>(); alInfo.add(peI.getCause().getMessage()); alInfo.add(peI.getCause().getStackTrace().toString()); } throw en; }