HHH-14727 Minor code cleanup in StandardSQLExceptionConverter
This commit is contained in:
parent
e4199decb5
commit
5616284a12
|
@ -19,22 +19,15 @@ import org.hibernate.exception.spi.SQLExceptionConverter;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class StandardSQLExceptionConverter implements SQLExceptionConverter {
|
public class StandardSQLExceptionConverter implements SQLExceptionConverter {
|
||||||
private ArrayList<SQLExceptionConversionDelegate> delegates = new ArrayList<SQLExceptionConversionDelegate>();
|
|
||||||
|
private final ArrayList<SQLExceptionConversionDelegate> delegates = new ArrayList<SQLExceptionConversionDelegate>(4);
|
||||||
|
|
||||||
public StandardSQLExceptionConverter() {
|
public StandardSQLExceptionConverter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public StandardSQLExceptionConverter(SQLExceptionConversionDelegate... delegates) {
|
|
||||||
if ( delegates != null ) {
|
|
||||||
this.delegates.addAll( Arrays.asList( delegates ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addDelegate(SQLExceptionConversionDelegate delegate) {
|
public void addDelegate(SQLExceptionConversionDelegate delegate) {
|
||||||
if ( delegate != null ) {
|
|
||||||
this.delegates.add( delegate );
|
this.delegates.add( delegate );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JDBCException convert(SQLException sqlException, String message, String sql) {
|
public JDBCException convert(SQLException sqlException, String message, String sql) {
|
||||||
|
|
Loading…
Reference in New Issue