final String name = (String) e.getKey(); final TypedValue typedVal = (TypedValue) e.getValue(); final int[] locations = source.getNamedParameterLocations( name ); for ( int location : locations ) { if ( debugEnabled ) {
public static int bindNamedParameters( final PreparedStatement ps, final Map namedParams, final int start, final NamedParameterSource source, final SessionImplementor session) throws SQLException, HibernateException { if ( namedParams != null ) { // assumes that types are all of span 1 Iterator iter = namedParams.entrySet().iterator(); int result = 0; while ( iter.hasNext() ) { Map.Entry e = ( Map.Entry ) iter.next(); String name = ( String ) e.getKey(); TypedValue typedval = (TypedValue) e.getValue(); int[] locations = source.getNamedParameterLocations( name ); for ( int i = 0; i < locations.length; i++ ) { if ( LOG.isDebugEnabled() ) { LOG.debugf("bindNamedParameters() %s -> %s [%s]", typedval.getValue(), name, locations[i] + start); } typedval.getType().nullSafeSet( ps, typedval.getValue(), locations[i] + start, session ); } result += locations.length; } return result; } return 0; } }
public static int bindNamedParameters( final PreparedStatement ps, final Map namedParams, final int start, final NamedParameterSource source, final SessionImplementor session) throws SQLException, HibernateException { if ( namedParams != null ) { // assumes that types are all of span 1 Iterator iter = namedParams.entrySet().iterator(); int result = 0; while ( iter.hasNext() ) { Map.Entry e = ( Map.Entry ) iter.next(); String name = ( String ) e.getKey(); TypedValue typedval = (TypedValue) e.getValue(); int[] locations = source.getNamedParameterLocations( name ); for ( int i = 0; i < locations.length; i++ ) { if ( LOG.isDebugEnabled() ) { LOG.debugf("bindNamedParameters() %s -> %s [%s]", typedval.getValue(), name, locations[i] + start); } typedval.getType().nullSafeSet( ps, typedval.getValue(), locations[i] + start, session ); } result += locations.length; } return result; } return 0; } }