Skip to content

Commit 26600ae

Browse files
committed
HHH-17314 - Fix inconsistent Exception throwing in ParameterRecognizerImpl
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 763a70f commit 26600ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hibernate-core/src/main/java/org/hibernate/query/sql/internal/ParameterRecognizerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void ordinalParameter(int sourcePosition) {
100100
parameterStyle = ParameterStyle.JDBC;
101101
}
102102
else if ( parameterStyle != ParameterStyle.JDBC ) {
103-
throw new IllegalStateException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
103+
throw new ParameterRecognitionException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
104104
}
105105

106106
int implicitPosition = ordinalParameterImplicitPosition++;
@@ -164,7 +164,7 @@ public void jpaPositionalParameter(int position, int sourcePosition) {
164164
parameterStyle = ParameterStyle.NAMED;
165165
}
166166
else if ( parameterStyle != ParameterStyle.NAMED ) {
167-
throw new IllegalStateException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
167+
throw new ParameterRecognitionException( "Cannot mix parameter styles between JDBC-style, ordinal and named in the same query" );
168168
}
169169

170170
if ( position < 1 ) {

0 commit comments

Comments
 (0)