1 | if ( namedParams != null ) {↵ | | 1 | if ( namedParams != null ) {↵
|
2 | // assumes that types are all of span 1↵ | | 2 | // assumes that types are all of span 1↵
|
3 | Iterator iter = namedParams.entrySet().iterator();↵ | | 3 | Iterator iter = namedParams.entrySet().iterator();↵
|
4 | int result = 0;↵ | | 4 | int result = 0;↵
|
5 | while ( iter.hasNext() ) {↵ | | 5 | while ( iter.hasNext() ) {↵
|
6 | Map.Entry e = ( Map.Entry ) iter.next();↵ | | 6 | Map.Entry e = ( Map.Entry ) iter.next();↵
|
7 | String name = ( String ) e.getKey();↵ | | 7 | String name = ( String ) e.getKey();↵
|
8 | TypedValue typedval = ( TypedValue ) e.getValue();↵ | | 8 | TypedValue typedval = ( TypedValue ) e.getValue();↵
|
9 | int[] locations = source.getNamedParameterLocations( name );↵ | | 9 | int[] locs = getNamedParameterLocs( name );↵
|
10 | for ( int i = 0; i < locations.length; i++ ) {↵ | | 10 | for ( int i = 0; i < locs.length; i++ ) {↵
|
11 | if ( log.isDebugEnabled() ) {↵ | | 11 | if ( log.isDebugEnabled() ) {↵
|
12 | log.debug( ↵ | | 12 | log.debug(↵
|
13 | "bindNamedParameters() " +↵ | | 13 | "bindNamedParameters() " +↵
|
14 | typedval.getValue() + " -> " + name +↵ | | 14 | typedval.getValue() + " -> " + name +↵
|
15 | " [" + ( locations[i] + start ) + "]" ↵ | | 15 | " [" + ( locs[i] + startIndex ) + "]"↵
|
16 | );↵ | | 16 | );↵
|
17 | }↵ | | 17 | }↵
|
18 | typedval.getType().nullSafeSet( ps, typedval.getValue(), locations[i] + start, session );↵ | | 18 | typedval.getType().nullSafeSet( statement, typedval.getValue(), locs[i] + startIndex, session );↵
|
19 | }↵ | | 19 | }↵
|
20 | result += locations.length;↵ | | 20 | result += locs.length;↵
|
21 | }↵ | | 21 | }↵
|
22 | return result;↵ | | 22 | return result;↵
|
23 | }↵ | | 23 | }↵
|
24 | else {↵ | | 24 | else {↵
|
25 | return 0;↵ | | 25 | return 0;↵
|
26 | } | | 26 | }
|