HHH-14041 - H2Dialect: fix referential integrity constraint constraint name extraction

This commit is contained in:
Gittenburg 2020-05-24 12:35:03 +02:00 committed by Sanne Grinovero
parent 0eca528cc5
commit 33e51c0c47
1 changed files with 3 additions and 0 deletions

View File

@ -330,6 +330,9 @@ public class H2Dialect extends Dialect {
if ( idx > 0 ) {
constraintName = message.substring( idx + "violation: ".length() );
}
if ( sqle.getSQLState().equals("23506") ) {
constraintName = constraintName.substring( 1, constraintName.indexOf(":") );
}
}
return constraintName;
}