Class AbstractSqlExceptionHandler
- java.lang.Object
-
- io.vertigo.database.impl.sql.vendor.core.AbstractSqlExceptionHandler
-
- All Implemented Interfaces:
SqlExceptionHandler
public abstract class AbstractSqlExceptionHandler extends Object implements 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
Constructors Constructor Description AbstractSqlExceptionHandler()
Crée une nouvelle instance de AbstractSqlExceptionHandler.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract String
extractConstraintName(String msg)
protected io.vertigo.core.lang.VUserException
handleConstraintSQLException(SQLException sqle, io.vertigo.core.locale.MessageKey defaultMsg)
Traite l'exception lié à la contrainte d'intégrité.protected io.vertigo.core.lang.VUserException
handleForeignConstraintSQLException(SQLException sqle)
protected RuntimeException
handleOtherSQLException(SQLException sqle, String statementInfos)
protected io.vertigo.core.lang.VUserException
handleTooLargeValueSqlException(SQLException sqle)
protected io.vertigo.core.lang.VUserException
handleUniqueConstraintSQLException(SQLException sqle)
protected io.vertigo.core.lang.VUserException
handleUserSQLException(SQLException sqle)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertigo.database.sql.vendor.SqlExceptionHandler
handleSQLException
-
-
-
-
Method Detail
-
extractConstraintName
protected abstract String extractConstraintName(String msg)
- Parameters:
msg
- Message base de données- Returns:
- Code de la contrainte
-
handleTooLargeValueSqlException
protected final io.vertigo.core.lang.VUserException handleTooLargeValueSqlException(SQLException sqle)
- Parameters:
sqle
- Exception base de données
-
handleUserSQLException
protected 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.MessageKey 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 final RuntimeException handleOtherSQLException(SQLException sqle, String statementInfos)
- Parameters:
sqle
- OtherSQLExceptionstatementInfos
- the statement
-
-