diff --git a/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ParameterParser.java b/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ParameterParser.java index 67a7291ece..5d709e5a1d 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ParameterParser.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ParameterParser.java @@ -22,7 +22,7 @@ import org.hibernate.query.sql.spi.ParameterRecognizer; * @author Steve Ebersole */ public class ParameterParser { - private static final String HQL_SEPARATORS = " \n\r\f\t,()=<>&|+-=/*'^![]#~\\"; + private static final String HQL_SEPARATORS = " \n\r\f\t,;()=<>&|+-=/*'^![]#~\\"; private static final BitSet HQL_SEPARATORS_BITSET = new BitSet(); static { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ParameterParserTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ParameterParserTest.java index 9c0c9a0d7f..40fa6ec0aa 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ParameterParserTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ParameterParserTest.java @@ -181,6 +181,18 @@ public class ParameterParserTest { assertTrue(recognizer.getNamedParameters().contains("pxyz")); assertEquals( 2, recognizer.getNamedParameters().size() ); } + + @Test + public void testParseNamedParameterEndWithSemicolon() { + ExtendedParameterRecognizer recognizer = createRecognizer(); + NATIVE_QUERY_INTERPRETER.recognizeParameters("from Stock s where s.stockCode = :stockCode and s.xyz = :pxyz;", recognizer); + recognizer.complete(); + recognizer.validate(); + + assertTrue(recognizer.getNamedParameters().contains("stockCode")); + assertTrue(recognizer.getNamedParameters().contains("pxyz")); + assertEquals( 2, recognizer.getNamedParameters().size() ); + } @Test public void testParseJPAPositionalParameter() {