Fix javadoc/comments to indicate ordinals are stored 0-based rather than 1-based.
This commit is contained in:
parent
5a328d1d72
commit
6e5a4e6335
|
@ -109,7 +109,7 @@ public class ParameterMetadataImpl implements ParameterMetadata {
|
|||
/**
|
||||
* Get the descriptor for an ordinal parameter given its position
|
||||
*
|
||||
* @param position The position (1 based)
|
||||
* @param position The position (0 based)
|
||||
*
|
||||
* @return The ordinal parameter descriptor
|
||||
*
|
||||
|
@ -119,7 +119,7 @@ public class ParameterMetadataImpl implements ParameterMetadata {
|
|||
if ( position < 0 || position >= ordinalDescriptors.length ) {
|
||||
throw new QueryParameterException(
|
||||
"Position beyond number of declared ordinal parameters. " +
|
||||
"Remember that ordinal parameters are 1-based! Position: " + position
|
||||
"Remember that ordinal parameters are 0-based! Position: " + position
|
||||
);
|
||||
}
|
||||
return ordinalDescriptors[position];
|
||||
|
|
|
@ -208,7 +208,6 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
|
|||
if ( position < positionalParameterBindings.size() ) {
|
||||
binding = positionalParameterBindings.get( position );
|
||||
if ( binding == null ) {
|
||||
// metadata parameters are 1-based
|
||||
binding = makeBinding( parameterMetadata.getQueryParameter( position ) );
|
||||
positionalParameterBindings.set( position, binding );
|
||||
}
|
||||
|
@ -217,7 +216,6 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
|
|||
for ( int i = 0; i < position - positionalParameterBindings.size(); i++ ) {
|
||||
positionalParameterBindings.add( null );
|
||||
}
|
||||
// metadata parameters are 1-based
|
||||
QueryParameter queryParameter = parameterMetadata.getQueryParameter( position );
|
||||
binding = makeBinding( queryParameter );
|
||||
positionalParameterBindings.add( binding );
|
||||
|
|
Loading…
Reference in New Issue