30
30
import org .hibernate .exception .spi .SQLExceptionConversionDelegate ;
31
31
import org .hibernate .exception .spi .TemplatedViolatedConstraintNameExtractor ;
32
32
import org .hibernate .exception .spi .ViolatedConstraintNameExtractor ;
33
- import org .hibernate .internal .util .JdbcExceptionHelper ;
34
33
import org .hibernate .query .sqm .IntervalType ;
35
34
import org .hibernate .query .common .TemporalUnit ;
36
35
import org .hibernate .service .ServiceRegistry ;
50
49
import jakarta .persistence .TemporalType ;
51
50
52
51
import static org .hibernate .exception .spi .TemplatedViolatedConstraintNameExtractor .extractUsingTemplate ;
52
+ import static org .hibernate .internal .util .JdbcExceptionHelper .extractErrorCode ;
53
+ import static org .hibernate .internal .util .JdbcExceptionHelper .extractSqlState ;
53
54
import static org .hibernate .type .SqlTypes .BIGINT ;
54
55
import static org .hibernate .type .SqlTypes .BOOLEAN ;
55
56
import static org .hibernate .type .SqlTypes .DATE ;
@@ -634,8 +635,8 @@ public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor() {
634
635
*/
635
636
private static final ViolatedConstraintNameExtractor EXTRACTOR =
636
637
new TemplatedViolatedConstraintNameExtractor ( sqle -> {
637
- final String sqlState = JdbcExceptionHelper . extractSqlState ( sqle );
638
- final int errorCode = JdbcExceptionHelper . extractErrorCode ( sqle );
638
+ final String sqlState = extractSqlState ( sqle );
639
+ final int errorCode = extractErrorCode ( sqle );
639
640
if ( sqlState != null ) {
640
641
switch ( sqlState ) {
641
642
case "S1000" :
@@ -660,8 +661,8 @@ public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() {
660
661
return null ;
661
662
}
662
663
return (sqlException , message , sql ) -> {
663
- final String sqlState = JdbcExceptionHelper . extractSqlState ( sqlException );
664
- final int errorCode = JdbcExceptionHelper . extractErrorCode ( sqlException );
664
+ final String sqlState = extractSqlState ( sqlException );
665
+ final int errorCode = extractErrorCode ( sqlException );
665
666
if ( sqlState != null ) {
666
667
switch ( sqlState ) {
667
668
case "HY008" :
0 commit comments