@@ -32,42 +32,41 @@ void identificationOfParameters() {
32
32
33
33
SoftAssertions softly = new SoftAssertions ();
34
34
35
- checkHasParameter (softly , "select something from x where id = :id" , true , "named parameter" , false );
36
- checkHasParameter (softly , "in the :id middle" , true , "middle" , false );
37
- checkHasParameter (softly , ":id start" , true , "beginning" , false );
38
- checkHasParameter (softly , ":id" , true , "alone" , false );
39
- checkHasParameter (softly , "select something from x where id = :id" , true , "named parameter" , false );
40
- checkHasParameter (softly , ":UPPERCASE" , true , "uppercase" , false );
41
- checkHasParameter (softly , ":lowercase" , true , "lowercase" , false );
42
- checkHasParameter (softly , ":2something" , true , "beginning digit" , false );
43
- checkHasParameter (softly , ":2" , true , "only digit" , false );
44
- checkHasParameter (softly , ":.something" , true , "dot" , false ); // <--
45
- checkHasParameter (softly , ":_something" , true , "underscore" , false );
46
- checkHasParameter (softly , ":$something" , true , "dollar" , false ); // <--
47
- checkHasParameter (softly , ":\uFE0F " , true , "non basic latin emoji" , false ); // <--
48
- checkHasParameter (softly , ":\u4E01 " , true , "chinese japanese korean" , false );
49
- checkHasParameter (softly , "select something from x where id = ?1" , true , "indexed parameter" , false );
35
+ checkHasParameter (softly , "select something from x where id = :id" , true , "named parameter" );
36
+ checkHasParameter (softly , "in the :id middle" , true , "middle" );
37
+ checkHasParameter (softly , ":id start" , true , "beginning" );
38
+ checkHasParameter (softly , ":id" , true , "alone" );
39
+ checkHasParameter (softly , "select something from x where id = :id" , true , "named parameter" );
40
+ checkHasParameter (softly , ":UPPERCASE" , true , "uppercase" );
41
+ checkHasParameter (softly , ":lowercase" , true , "lowercase" );
42
+ checkHasParameter (softly , ":2something" , true , "beginning digit" );
43
+ checkHasParameter (softly , ":2" , true , "only digit" );
44
+ checkHasParameter (softly , ":.something" , true , "dot" ); // <--
45
+ checkHasParameter (softly , ":_something" , true , "underscore" );
46
+ checkHasParameter (softly , ":$something" , true , "dollar" ); // <--
47
+ checkHasParameter (softly , ":\uFE0F " , true , "non basic latin emoji" ); // <--
48
+ checkHasParameter (softly , ":\u4E01 " , true , "chinese japanese korean" );
49
+ checkHasParameter (softly , "select something from x where id = ?1" , true , "indexed parameter" );
50
50
51
51
// <-- should we accept hash as named parameter start?
52
- checkHasParameter (softly , "select something from x where id = #something" , false , "hash" , false );
52
+ checkHasParameter (softly , "select something from x where id = #something" , false , "hash" );
53
53
54
- checkHasParameter (softly , "no bind variable" , false , "no bind variable" , false );
55
- checkHasParameter (softly , ":\u2004 whitespace" , false , "non basic latin whitespace" , false ); // <--
56
- checkHasParameter (softly , "::" , false , "double colon" , false );
57
- checkHasParameter (softly , ":" , false , "end of query" , false );
58
- checkHasParameter (softly , ":\u0003 " , false , "non-printable" , false );
59
- checkHasParameter (softly , ":\u002A " , false , "basic latin emoji" , false );
60
- checkHasParameter (softly , "\\ :" , false , "escaped colon" , false );
61
- checkHasParameter (softly , "::id" , false , "double colon with identifier" , false );
62
- checkHasParameter (softly , "\\ :id" , false , "escaped colon with identifier" , false );
54
+ checkHasParameter (softly , "no bind variable" , false , "no bind variable" );
55
+ checkHasParameter (softly , ":\u2004 whitespace" , false , "non basic latin whitespace" ); // <--
56
+ checkHasParameter (softly , "::" , false , "double colon" );
57
+ checkHasParameter (softly , ":" , false , "end of query" );
58
+ checkHasParameter (softly , ":\u0003 " , false , "non-printable" );
59
+ checkHasParameter (softly , ":\u002A " , false , "basic latin emoji" );
60
+ checkHasParameter (softly , "\\ :" , false , "escaped colon" );
61
+ checkHasParameter (softly , "::id" , false , "double colon with identifier" );
62
+ checkHasParameter (softly , "\\ :id" , false , "escaped colon with identifier" );
63
63
64
64
softly .assertAll ();
65
65
}
66
66
67
- private void checkHasParameter (SoftAssertions softly , String query , boolean containsParameter , String label ,
68
- boolean nativeQuery ) {
67
+ private void checkHasParameter (SoftAssertions softly , String query , boolean containsParameter , String label ) {
69
68
70
- StringQuery stringQuery = new StringQuery (query , nativeQuery );
69
+ StringQuery stringQuery = new StringQuery (query , false );
71
70
72
71
softly .assertThat (stringQuery .getParameterBindings ().size ()) //
73
72
.describedAs (String .format ("<%s> (%s)" , query , label )) //
0 commit comments