Support SQUARE brackets [] around NAMED parameter
This commit is contained in:
committed by
Juergen Hoeller
parent
aeff664cf9
commit
86eda279c8
@@ -38,6 +38,7 @@ import static org.mockito.Mockito.verify;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Jens Schauder
|
||||
* @author Anton Naydenov
|
||||
*/
|
||||
public class NamedParameterUtilsUnitTests {
|
||||
|
||||
@@ -274,6 +275,18 @@ public class NamedParameterUtilsUnitTests {
|
||||
assertThat(psql2.getParameterNames()).containsExactly("xxx");
|
||||
}
|
||||
|
||||
@Test public void parseSqlStatementWithSquareBracket() {
|
||||
// given
|
||||
String sql = "SELECT ARRAY[:ext]";
|
||||
|
||||
// when
|
||||
ParsedSql psql = NamedParameterUtils.parseSqlStatement(sql);
|
||||
|
||||
//then
|
||||
assertThat(psql.getNamedParameterCount()).isEqualTo(1);
|
||||
assertThat(psql.getParameterNames()).containsExactly("ext");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldAllowParsingMultipleUseOfParameter() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user