Class AbstractSqlExceptionHandler
java.lang.Object
io.vertigo.database.impl.sql.vendor.core.AbstractSqlExceptionHandler
- All Implemented Interfaces:
SqlExceptionHandler
Handler abstrait des exceptions SQL qui peuvent survenir dans un service.
Cette classe est abstraite et doit être concretisée par une sous-classe.
Dans le cas d'une contrainte d'intégrité référentiel ou d'unicité, le message de
l'erreur utilisateur doit être specialisé en l'ajoutant comme ressource dans
le RessourceManager en utilisant le nom de la contrainte comme clef.
- Author:
- npiedeloup, evernat
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCrée une nouvelle instance de AbstractSqlExceptionHandler. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Stringprotected final io.vertigo.core.lang.VUserExceptionhandleConstraintSQLException(SQLException sqle, io.vertigo.core.locale.LocaleMessageKey defaultMsg) Traite l'exception lié à la contrainte d'intégrité.protected final io.vertigo.core.lang.VUserExceptionprotected static final RuntimeExceptionhandleOtherSQLException(SQLException sqle, String statementInfos) protected static final io.vertigo.core.lang.VUserExceptionprotected final io.vertigo.core.lang.VUserExceptionprotected static final io.vertigo.core.lang.VUserExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.vertigo.database.sql.vendor.SqlExceptionHandler
handleSQLException
-
Constructor Details
-
AbstractSqlExceptionHandler
protected AbstractSqlExceptionHandler()Crée une nouvelle instance de AbstractSqlExceptionHandler.
-
-
Method Details
-
extractConstraintName
- Parameters:
msg- Message base de données- Returns:
- Code de la contrainte
-
handleTooLargeValueSqlException
protected static final io.vertigo.core.lang.VUserException handleTooLargeValueSqlException(SQLException sqle) - Parameters:
sqle- Exception base de données
-
handleUserSQLException
protected static final io.vertigo.core.lang.VUserException handleUserSQLException(SQLException sqle) - Parameters:
sqle- SQLException launch by SQL (often PLSQL application specific exception with <text> tag)
-
handleConstraintSQLException
protected final io.vertigo.core.lang.VUserException handleConstraintSQLException(SQLException sqle, io.vertigo.core.locale.LocaleMessageKey defaultMsg) Traite l'exception lié à la contrainte d'intégrité. Et lance une KUserException avec le message par défaut passé en paramètre et une MessageKey basé sur le nom de la contrainte.- Parameters:
sqle- Exception SQLdefaultMsg- Message par defaut
-
handleForeignConstraintSQLException
protected final io.vertigo.core.lang.VUserException handleForeignConstraintSQLException(SQLException sqle) - Parameters:
sqle- ForeignConstraintSQLException
-
handleUniqueConstraintSQLException
protected final io.vertigo.core.lang.VUserException handleUniqueConstraintSQLException(SQLException sqle) - Parameters:
sqle- UniqueConstraintSQLException
-
handleOtherSQLException
protected static final RuntimeException handleOtherSQLException(SQLException sqle, String statementInfos) - Parameters:
sqle- OtherSQLExceptionstatementInfos- the statement
-