/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); if (dict == null) return new StoreException(msg).setFailedObject(failed). setNestedThrowables(ses); return dict.newStoreException(msg, ses, failed); }
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict, int level) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed) .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed); if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) { LockException lockEx = (LockException) storeEx; lockEx.setLockLevel(level); } return storeEx; }
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict, int level) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed) .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed); if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) { LockException lockEx = (LockException) storeEx; lockEx.setLockLevel(level); } return storeEx; }
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict, int level) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed) .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed); if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) { LockException lockEx = (LockException) storeEx; lockEx.setLockLevel(level); } return storeEx; }
/** * Convert the specified exception into a {@link StoreException}. */ public static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict, int level) { if (msg == null) msg = se.getClass().getName(); SQLException[] ses = getSQLExceptions(se); OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed) .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed); if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) { LockException lockEx = (LockException) storeEx; lockEx.setLockLevel(level); } return storeEx; }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = SQLExceptions.narrow(msg, causes[0], this); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }