title: Calling a stored procedure from Hibernate using named parameters
body: <p>I am trying to call a MS SQL Server stored procedure from Hibernate 4.3.5.Final using the org.hibernate.procedure.ProcedureCall interface using named parameters instead of positional parameters.  I have something like this:</p>
  
  <pre><code>ProcedureCall call = session.createStoredProcedureCall(procedureName);
  call.registerParameter("parameter1Name", Integer.class, ParameterMode.IN).bindValue(1);
  call.registerParameter("parameter2Name", Integer.class, ParameterMode.IN).bindValue(2);
  call.getOutputs();
  </code></pre>
  
  <p>But I end up with this:</p>
  
  <pre><code>{call procedure_name (1, 2)};
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>{call procedure_name (@parameter1Name = 1, @parameter2Name = 2)};
  </code></pre>
  
  <p>Note that there are no parameter names and the parameters are in exactly the order that they were specified.<br>
  NamedParameterRegistration inherits from AbstractParameterRegistrationImpl and doesn't override prepare().  For a parameter with a mode of IN or INOUT, it calls </p>
  
  <pre><code>typeToUse.nullSafeSet( statement, bind.getValue(), startIndex, session() );
  </code></pre>
  
  <p>which simply binds the parameter as an ordered parameter.  </p>
  
  <p>Is there something that I am missing, or is this just broken right now?</p>