Fix javadoc/comments to indicate ordinals are stored 0-based rather than 1-based.

This commit is contained in:
Chris Cranford 2016-05-02 14:36:05 -05:00 committed by Steve Ebersole
parent 5a328d1d72
commit 6e5a4e6335
2 changed files with 2 additions and 4 deletions

View File

@ -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];

View File

@ -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 );