HHH-17314 - Fix inconsistent Exception throwing in ParameterRecognizerImpl

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2023-10-19 23:05:14 +02:00 committed by Jan Schatteman
parent 763a70f633
commit 26600ae4a6
1 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ public class ParameterRecognizerImpl implements ParameterRecognizer {
parameterStyle = ParameterStyle.JDBC;
}
else if ( parameterStyle != ParameterStyle.JDBC ) {
throw new IllegalStateException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
throw new ParameterRecognitionException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
}
int implicitPosition = ordinalParameterImplicitPosition++;
@ -164,7 +164,7 @@ public class ParameterRecognizerImpl implements ParameterRecognizer {
parameterStyle = ParameterStyle.NAMED;
}
else if ( parameterStyle != ParameterStyle.NAMED ) {
throw new IllegalStateException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
throw new ParameterRecognitionException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
}
if ( position < 1 ) {