mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 04:34:49 +00:00
HHH-8319 checkstyle
This commit is contained in:
parent
5abe02f92d
commit
77fd4d6a89
@ -57,19 +57,19 @@ public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter() {
|
|||||||
return EXTRACTER;
|
return EXTRACTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() {
|
private static final ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() {
|
||||||
|
|
||||||
public String extractConstraintName(SQLException sqle) {
|
public String extractConstraintName(SQLException sqle) {
|
||||||
try {
|
try {
|
||||||
int sqlState = Integer.valueOf( JdbcExceptionHelper.extractSqlState( sqle ) ).intValue();
|
final int sqlState = Integer.valueOf( JdbcExceptionHelper.extractSqlState( sqle ) ).intValue();
|
||||||
switch ( sqlState ) {
|
switch ( sqlState ) {
|
||||||
case 23000:
|
case 23000:
|
||||||
return extractUsingTemplate( " for key '", "'", sqle.getMessage() );
|
return extractUsingTemplate( " for key '", "'", sqle.getMessage() );
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NumberFormatException nfe) {
|
catch ( NumberFormatException nfe ) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user