FileDocCategorySizeDatePackage
AbstractQueryImpl.javaAPI DocHibernate 3.2.525221Tue Nov 21 14:57:32 GMT 2006org.hibernate.impl

AbstractQueryImpl

public abstract class AbstractQueryImpl extends Object implements org.hibernate.Query
Abstract implementation of the Query interface.
author
Gavin King, Max Andersen

Fields Summary
private static final Object
UNSET_PARAMETER
private static final Object
UNSET_TYPE
private final String
queryString
protected final org.hibernate.engine.SessionImplementor
session
protected final org.hibernate.engine.query.ParameterMetadata
parameterMetadata
private List
values
private List
types
private Map
namedParameters
private Map
namedParameterLists
private Object
optionalObject
private Serializable
optionalId
private String
optionalEntityName
private org.hibernate.engine.RowSelection
selection
private boolean
cacheable
private String
cacheRegion
private String
comment
private org.hibernate.FlushMode
flushMode
private org.hibernate.CacheMode
cacheMode
private org.hibernate.FlushMode
sessionFlushMode
private org.hibernate.CacheMode
sessionCacheMode
private Serializable
collectionKey
private boolean
readOnly
private org.hibernate.transform.ResultTransformer
resultTransformer
Constructors Summary
public AbstractQueryImpl(String queryString, org.hibernate.FlushMode flushMode, org.hibernate.engine.SessionImplementor session, org.hibernate.engine.query.ParameterMetadata parameterMetadata)


	 
			 
	         
	         
	          
		this.session = session;
		this.queryString = queryString;
		this.selection = new RowSelection();
		this.flushMode = flushMode;
		this.cacheMode = null;
		this.parameterMetadata = parameterMetadata;
	
Methods Summary
protected voidafter()

		if (sessionFlushMode!=null) {
			getSession().setFlushMode(sessionFlushMode);
			sessionFlushMode = null;
		}
		if (sessionCacheMode!=null) {
			getSession().setCacheMode(sessionCacheMode);
			sessionCacheMode = null;
		}
	
protected voidbefore()

		if ( flushMode!=null ) {
			sessionFlushMode = getSession().getFlushMode();
			getSession().setFlushMode(flushMode);
		}
		if ( cacheMode!=null ) {
			sessionCacheMode = getSession().getCacheMode();
			getSession().setCacheMode(cacheMode);
		}
	
protected org.hibernate.type.TypedetermineType(int paramPosition, java.lang.Object paramValue, org.hibernate.type.Type defaultType)

		Type type = parameterMetadata.getOrdinalParameterExpectedType( paramPosition + 1 );
		if ( type == null ) {
			type = defaultType;
		}
		return type;
	
protected org.hibernate.type.TypedetermineType(int paramPosition, java.lang.Object paramValue)

		Type type = parameterMetadata.getOrdinalParameterExpectedType( paramPosition + 1 );
		if ( type == null ) {
			type = guessType( paramValue );
		}
		return type;
	
protected org.hibernate.type.TypedetermineType(java.lang.String paramName, java.lang.Object paramValue, org.hibernate.type.Type defaultType)

		Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
		if ( type == null ) {
			type = defaultType;
		}
		return type;
	
protected org.hibernate.type.TypedetermineType(java.lang.String paramName, java.lang.Object paramValue)

		Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
		if ( type == null ) {
			type = guessType( paramValue );
		}
		return type;
	
protected org.hibernate.type.TypedetermineType(java.lang.String paramName, java.lang.Class clazz)

		Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
		if ( type == null ) {
			type = guessType( clazz );
		}
		return type;
	
private java.lang.StringexpandParameterList(java.lang.String query, java.lang.String name, org.hibernate.engine.TypedValue typedList, java.util.Map namedParamsCopy)
Warning: adds new parameters to the argument by side-effect, as well as mutating the query string!

		Collection vals = (Collection) typedList.getValue();
		Type type = typedList.getType();
		if ( vals.size() == 1 ) {
			// short-circuit for performance...
			namedParamsCopy.put( name, new TypedValue( type, vals.iterator().next(), session.getEntityMode() ) );
			return query;
		}

		StringBuffer list = new StringBuffer( 16 );
		Iterator iter = vals.iterator();
		int i = 0;
		boolean isJpaPositionalParam = parameterMetadata.getNamedParameterDescriptor( name ).isJpaStyle();
		while ( iter.hasNext() ) {
			String alias = ( isJpaPositionalParam ? 'x" + name : name ) + i++ + '_";
			namedParamsCopy.put( alias, new TypedValue( type, iter.next(), session.getEntityMode() ) );
			list.append( ParserHelper.HQL_VARIABLE_PREFIX ).append( alias );
			if ( iter.hasNext() ) {
				list.append( ", " );
			}
		}
		String paramPrefix = isJpaPositionalParam ? "?" : ParserHelper.HQL_VARIABLE_PREFIX;
		return StringHelper.replace( query, paramPrefix + name, list.toString(), true );
	
protected java.lang.StringexpandParameterLists(java.util.Map namedParamsCopy)
Warning: adds new parameters to the argument by side-effect, as well as mutating the query string!

		String query = this.queryString;
		Iterator iter = namedParameterLists.entrySet().iterator();
		while ( iter.hasNext() ) {
			Map.Entry me = (Map.Entry) iter.next();
			query = expandParameterList( query, (String) me.getKey(), (TypedValue) me.getValue(), namedParamsCopy );
		}
		return query;
	
protected abstract java.util.MapgetLockModes()

protected java.util.MapgetNamedParameterLists()
Retreive the value map for any named parameter lists (i.e., for auto-expansion) bound to this query.

return
The parameter list value map.

		return namedParameterLists;
	
public java.lang.String[]getNamedParameters()
Returns an array representing all named parameter names encountered during (intial) parsing of the query.

Note initial here means different things depending on whether this is a native-sql query or an HQL/filter query. For native-sql, a precursory inspection of the query string is performed specifically to locate defined parameters. For HQL/filter queries, this is the information returned from the query-translator. This distinction holds true for all parameter metadata exposed here.

return
Array of named parameter names.
throws
HibernateException

		return ArrayHelper.toStringArray( parameterMetadata.getNamedParameterNames() );
	
protected java.util.MapgetNamedParams()
Returns a shallow copy of the named parameter value map.

return
Shallow copy of the named parameter value map

		return new HashMap( namedParameters );
	
public org.hibernate.engine.QueryParametersgetQueryParameters(java.util.Map namedParams)

		return new QueryParameters(
				typeArray(),
				valueArray(),
				namedParams,
				getLockModes(),
				getSelection(),
				readOnly,
				cacheable,
				cacheRegion,
				comment,
				collectionKey == null ? null : new Serializable[] { collectionKey },
				optionalObject,
				optionalEntityName,
				optionalId,
				resultTransformer
		);
	
public final java.lang.StringgetQueryString()

		return queryString;
	
public java.lang.String[]getReturnAliases()

		return session.getFactory().getReturnAliases( queryString );
	
public org.hibernate.type.Type[]getReturnTypes()

		return session.getFactory().getReturnTypes( queryString );
	
protected org.hibernate.engine.RowSelectiongetRowSelection()

		return selection;
	
public org.hibernate.engine.RowSelectiongetSelection()

		return selection;
	
org.hibernate.engine.SessionImplementorgetSession()

		return session;
	
protected java.util.ListgetTypes()
Retreives the list of parameter {@link Type type}s bound to this query for ordinal parameters.

return
The ordinal parameter types.

		return types;
	
protected java.util.ListgetValues()
Retreives the list of parameter values bound to this query for ordinal parameters.

return
The ordinal parameter values.

		return values;
	
private org.hibernate.type.TypeguessType(java.lang.Object param)

		Class clazz = HibernateProxyHelper.getClassWithoutInitializingProxy( param );
		return guessType( clazz );
	
private org.hibernate.type.TypeguessType(java.lang.Class clazz)

		String typename = clazz.getName();
		Type type = TypeFactory.heuristicType(typename);
		boolean serializable = type!=null && type instanceof SerializableType;
		if (type==null || serializable) {
			try {
				session.getFactory().getEntityPersister( clazz.getName() );
			}
			catch (MappingException me) {
				if (serializable) {
					return type;
				}
				else {
					throw new HibernateException("Could not determine a type for class: " + typename);
				}
			}
			return Hibernate.entity(clazz);
		}
		else {
			return type;
		}
	
public booleanhasNamedParameters()
Does this query contain named parameters?

return
True if the query was found to contain named parameters; false otherwise;

		return parameterMetadata.getNamedParameterNames().size() > 0;
	
public booleanisReadOnly()

		return readOnly;
	
private java.lang.StringresolveEntityName(java.lang.Object val)

		if ( val == null ) {
			throw new IllegalArgumentException( "entity for parameter binding cannot be null" );
		}
		return session.bestGuessEntityName( val );
	
public org.hibernate.QuerysetBigDecimal(int position, java.math.BigDecimal number)

		setParameter(position, number, Hibernate.BIG_DECIMAL);
		return this;
	
public org.hibernate.QuerysetBigDecimal(java.lang.String name, java.math.BigDecimal number)

		setParameter(name, number, Hibernate.BIG_DECIMAL);
		return this;
	
public org.hibernate.QuerysetBigInteger(int position, java.math.BigInteger number)

		setParameter(position, number, Hibernate.BIG_INTEGER);
		return this;
	
public org.hibernate.QuerysetBigInteger(java.lang.String name, java.math.BigInteger number)

		setParameter(name, number, Hibernate.BIG_INTEGER);
		return this;
	
public org.hibernate.QuerysetBinary(int position, byte[] val)

		setParameter(position, val, Hibernate.BINARY);
		return this;
	
public org.hibernate.QuerysetBinary(java.lang.String name, byte[] val)

		setParameter(name, val, Hibernate.BINARY);
		return this;
	
public org.hibernate.QuerysetBoolean(int position, boolean val)

		Boolean valueToUse = val ? Boolean.TRUE : Boolean.FALSE;
		Type typeToUse = determineType( position, valueToUse, Hibernate.BOOLEAN );
		setParameter( position, valueToUse, typeToUse );
		return this;
	
public org.hibernate.QuerysetBoolean(java.lang.String name, boolean val)

		Boolean valueToUse = val ? Boolean.TRUE : Boolean.FALSE;
		Type typeToUse = determineType( name, valueToUse, Hibernate.BOOLEAN );
		setParameter( name, valueToUse, typeToUse );
		return this;
	
public org.hibernate.QuerysetByte(int position, byte val)

		setParameter(position, new Byte(val), Hibernate.BYTE);
		return this;
	
public org.hibernate.QuerysetByte(java.lang.String name, byte val)

		setParameter(name, new Byte(val), Hibernate.BYTE);
		return this;
	
public org.hibernate.QuerysetCacheMode(org.hibernate.CacheMode cacheMode)

		this.cacheMode = cacheMode;
		return this;
	
public org.hibernate.QuerysetCacheRegion(java.lang.String cacheRegion)

		if (cacheRegion != null)
			this.cacheRegion = cacheRegion.trim();
		return this;
	
public org.hibernate.QuerysetCacheable(boolean cacheable)

		this.cacheable = cacheable;
		return this;
	
public org.hibernate.QuerysetCalendar(int position, java.util.Calendar calendar)

		setParameter(position, calendar, Hibernate.CALENDAR);
		return this;
	
public org.hibernate.QuerysetCalendar(java.lang.String name, java.util.Calendar calendar)

		setParameter(name, calendar, Hibernate.CALENDAR);
		return this;
	
public org.hibernate.QuerysetCalendarDate(int position, java.util.Calendar calendar)

		setParameter(position, calendar, Hibernate.CALENDAR_DATE);
		return this;
	
public org.hibernate.QuerysetCalendarDate(java.lang.String name, java.util.Calendar calendar)

		setParameter(name, calendar, Hibernate.CALENDAR_DATE);
		return this;
	
public org.hibernate.QuerysetCharacter(int position, char val)

		setParameter(position, new Character(val), Hibernate.CHARACTER);
		return this;
	
public org.hibernate.QuerysetCharacter(java.lang.String name, char val)

		setParameter(name, new Character(val), Hibernate.CHARACTER);
		return this;
	
public org.hibernate.QuerysetCollectionKey(java.io.Serializable collectionKey)

		this.collectionKey = collectionKey;
		return this;
	
public org.hibernate.QuerysetComment(java.lang.String comment)

		this.comment = comment;
		return this;
	
public org.hibernate.QuerysetDate(int position, java.util.Date date)

		setParameter(position, date, Hibernate.DATE);
		return this;
	
public org.hibernate.QuerysetDate(java.lang.String name, java.util.Date date)

		setParameter(name, date, Hibernate.DATE);
		return this;
	
public org.hibernate.QuerysetDouble(int position, double val)

		setParameter(position, new Double(val), Hibernate.DOUBLE);
		return this;
	
public org.hibernate.QuerysetDouble(java.lang.String name, double val)

		setParameter(name, new Double(val), Hibernate.DOUBLE);
		return this;
	
public org.hibernate.QuerysetEntity(int position, java.lang.Object val)

		setParameter( position, val, Hibernate.entity( resolveEntityName( val ) ) );
		return this;
	
public org.hibernate.QuerysetEntity(java.lang.String name, java.lang.Object val)

		setParameter( name, val, Hibernate.entity( resolveEntityName( val ) ) );
		return this;
	
public org.hibernate.QuerysetFetchSize(int fetchSize)

		selection.setFetchSize( new Integer(fetchSize) );
		return this;
	
public org.hibernate.QuerysetFirstResult(int firstResult)

		selection.setFirstRow( new Integer(firstResult) );
		return this;
	
public org.hibernate.QuerysetFloat(int position, float val)

		setParameter(position, new Float(val), Hibernate.FLOAT);
		return this;
	
public org.hibernate.QuerysetFloat(java.lang.String name, float val)

		setParameter(name, new Float(val), Hibernate.FLOAT);
		return this;
	
public org.hibernate.QuerysetFlushMode(org.hibernate.FlushMode flushMode)

		this.flushMode = flushMode;
		return this;
	
public org.hibernate.QuerysetInteger(int position, int val)

		setParameter(position, new Integer(val), Hibernate.INTEGER);
		return this;
	
public org.hibernate.QuerysetInteger(java.lang.String name, int val)

		setParameter(name, new Integer(val), Hibernate.INTEGER);
		return this;
	
public org.hibernate.QuerysetLocale(int position, java.util.Locale locale)

		setParameter(position, locale, Hibernate.LOCALE);
		return this;
	
public org.hibernate.QuerysetLocale(java.lang.String name, java.util.Locale locale)

		setParameter(name, locale, Hibernate.LOCALE);
		return this;
	
public org.hibernate.QuerysetLong(int position, long val)

		setParameter(position, new Long(val), Hibernate.LONG);
		return this;
	
public org.hibernate.QuerysetLong(java.lang.String name, long val)

		setParameter(name, new Long(val), Hibernate.LONG);
		return this;
	
public org.hibernate.QuerysetMaxResults(int maxResults)

		selection.setMaxRows( new Integer(maxResults) );
		return this;
	
public voidsetOptionalEntityName(java.lang.String optionalEntityName)

		this.optionalEntityName = optionalEntityName;
	
public voidsetOptionalId(java.io.Serializable optionalId)

		this.optionalId = optionalId;
	
public voidsetOptionalObject(java.lang.Object optionalObject)

		this.optionalObject = optionalObject;
	
public org.hibernate.QuerysetParameter(int position, java.lang.Object val, org.hibernate.type.Type type)

		if ( parameterMetadata.getOrdinalParameterCount() == 0 ) {
			throw new IllegalArgumentException("No positional parameters in query: " + getQueryString() );
		}
		if ( position < 0 || position > parameterMetadata.getOrdinalParameterCount() - 1 ) {
			throw new IllegalArgumentException("Positional parameter does not exist: " + position + " in query: " + getQueryString() );
		}
		int size = values.size();
		if ( position < size ) {
			values.set( position, val );
			types.set( position, type );
		}
		else {
			// prepend value and type list with null for any positions before the wanted position.
			for ( int i = 0; i < position - size; i++ ) {
				values.add( UNSET_PARAMETER );
				types.add( UNSET_TYPE );
			}
			values.add( val );
			types.add( type );
		}
		return this;
	
public org.hibernate.QuerysetParameter(java.lang.String name, java.lang.Object val, org.hibernate.type.Type type)

		if ( !parameterMetadata.getNamedParameterNames().contains( name ) ) {
			throw new IllegalArgumentException("Parameter " + name + " does not exist as a named parameter in [" + getQueryString() + "]");
		}
		else {
			 namedParameters.put( name, new TypedValue( type, val, session.getEntityMode() ) );
			 return this;
		}
	
public org.hibernate.QuerysetParameter(int position, java.lang.Object val)

		if (val == null) {
			setParameter( position, val, Hibernate.SERIALIZABLE );
		}
		else {
			setParameter( position, val, determineType( position, val ) );
		}
		return this;
	
public org.hibernate.QuerysetParameter(java.lang.String name, java.lang.Object val)

		if (val == null) {
			Type type = parameterMetadata.getNamedParameterExpectedType( name );
			if ( type == null ) {
				type = Hibernate.SERIALIZABLE;
			}
			setParameter( name, val, type );
		}
		else {
			setParameter( name, val, determineType( name, val ) );
		}
		return this;
	
public org.hibernate.QuerysetParameterList(java.lang.String name, java.util.Collection vals, org.hibernate.type.Type type)

		if ( !parameterMetadata.getNamedParameterNames().contains( name ) ) {
			throw new IllegalArgumentException("Parameter " + name + " does not exist as a named parameter in [" + getQueryString() + "]");
		}
		namedParameterLists.put( name, new TypedValue( type, vals, session.getEntityMode() ) );
		return this;
	
public org.hibernate.QuerysetParameterList(java.lang.String name, java.util.Collection vals)

		if ( vals == null ) {
			throw new QueryException( "Collection must be not null!" );
		}

		if( vals.size() == 0 ) {
			setParameterList( name, vals, null );
		}
		else {
			setParameterList(name, vals, determineType( name, vals.iterator().next() ) );
		}

		return this;
	
public org.hibernate.QuerysetParameterList(java.lang.String name, java.lang.Object[] vals, org.hibernate.type.Type type)

		return setParameterList( name, Arrays.asList(vals), type );
	
public org.hibernate.QuerysetParameterList(java.lang.String name, java.lang.Object[] vals)

		return setParameterList( name, Arrays.asList(vals) );
	
public org.hibernate.QuerysetParameters(java.lang.Object[] values, org.hibernate.type.Type[] types)

		this.values = Arrays.asList(values);
		this.types = Arrays.asList(types);
		return this;
	
public org.hibernate.QuerysetProperties(java.util.Map map)

		String[] params = getNamedParameters();
		for (int i = 0; i < params.length; i++) {
			String namedParam = params[i];
				final Object object = map.get(namedParam);
				if(object==null) {
					continue;
				}
				Class retType = object.getClass();
				if ( Collection.class.isAssignableFrom( retType ) ) {
					setParameterList( namedParam, ( Collection ) object );
				}
				else if ( retType.isArray() ) {
					setParameterList( namedParam, ( Object[] ) object );
				}
				else {
					setParameter( namedParam, object, determineType( namedParam, retType ) );
				}

			
		}
		return this;				
	
public org.hibernate.QuerysetProperties(java.lang.Object bean)

		Class clazz = bean.getClass();
		String[] params = getNamedParameters();
		for (int i = 0; i < params.length; i++) {
			String namedParam = params[i];
			try {
				Getter getter = ReflectHelper.getGetter( clazz, namedParam );
				Class retType = getter.getReturnType();
				final Object object = getter.get( bean );
				if ( Collection.class.isAssignableFrom( retType ) ) {
					setParameterList( namedParam, ( Collection ) object );
				}
				else if ( retType.isArray() ) {
				 	setParameterList( namedParam, ( Object[] ) object );
				}
				else {
					setParameter( namedParam, object, determineType( namedParam, retType ) );
				}
			}
			catch (PropertyNotFoundException pnfe) {
				// ignore
			}
		}
		return this;
	
public org.hibernate.QuerysetReadOnly(boolean readOnly)

		this.readOnly = readOnly;
		return this;
	
public org.hibernate.QuerysetResultTransformer(org.hibernate.transform.ResultTransformer transformer)

		this.resultTransformer = transformer;
		return this;
	
public org.hibernate.QuerysetSerializable(int position, java.io.Serializable val)

		setParameter(position, val, Hibernate.SERIALIZABLE);
		return this;
	
public org.hibernate.QuerysetSerializable(java.lang.String name, java.io.Serializable val)

		setParameter(name, val, Hibernate.SERIALIZABLE);
		return this;
	
public org.hibernate.QuerysetShort(int position, short val)

		setParameter(position, new Short(val), Hibernate.SHORT);
		return this;
	
public org.hibernate.QuerysetShort(java.lang.String name, short val)

		setParameter(name, new Short(val), Hibernate.SHORT);
		return this;
	
public org.hibernate.QuerysetString(int position, java.lang.String val)

		setParameter(position, val, Hibernate.STRING);
		return this;
	
public org.hibernate.QuerysetString(java.lang.String name, java.lang.String val)

		setParameter(name, val, Hibernate.STRING);
		return this;
	
public org.hibernate.QuerysetText(int position, java.lang.String val)

		setParameter(position, val, Hibernate.TEXT);
		return this;
	
public org.hibernate.QuerysetText(java.lang.String name, java.lang.String val)

		setParameter(name, val, Hibernate.TEXT);
		return this;
	
public org.hibernate.QuerysetTime(int position, java.util.Date date)

		setParameter(position, date, Hibernate.TIME);
		return this;
	
public org.hibernate.QuerysetTime(java.lang.String name, java.util.Date date)

		setParameter(name, date, Hibernate.TIME);
		return this;
	
public org.hibernate.QuerysetTimeout(int timeout)

		selection.setTimeout( new Integer(timeout) );
		return this;
	
public org.hibernate.QuerysetTimestamp(int position, java.util.Date date)

		setParameter(position, date, Hibernate.TIMESTAMP);
		return this;
	
public org.hibernate.QuerysetTimestamp(java.lang.String name, java.util.Date date)

		setParameter(name, date, Hibernate.TIMESTAMP);
		return this;
	
public java.lang.StringtoString()

		return StringHelper.unqualify( getClass().getName() ) + '(" + queryString + ')";
	
public org.hibernate.type.Type[]typeArray()

		return ArrayHelper.toTypeArray( getTypes() );
	
static java.lang.ObjectuniqueElement(java.util.List list)

		int size = list.size();
		if (size==0) return null;
		Object first = list.get(0);
		for ( int i=1; i<size; i++ ) {
			if ( list.get(i)!=first ) {
				throw new NonUniqueResultException( list.size() );
			}
		}
		return first;
	
public java.lang.ObjectuniqueResult()

		return uniqueElement( list() );
	
public java.lang.Object[]valueArray()

		return getValues().toArray();
	
protected voidverifyParameters()
Perform parameter validation. Used prior to executing the encapsulated query.

throws
QueryException

		verifyParameters(false);
	
protected voidverifyParameters(boolean reserveFirstParameter)
Perform parameter validation. Used prior to executing the encapsulated query.

param
reserveFirstParameter if true, the first ? will not be verified since its needed for e.g. callable statements returning a out parameter
throws
HibernateException

		if ( parameterMetadata.getNamedParameterNames().size() != namedParameters.size() + namedParameterLists.size() ) {
			Set missingParams = new HashSet( parameterMetadata.getNamedParameterNames() );
			missingParams.removeAll( namedParameterLists.keySet() );
			missingParams.removeAll( namedParameters.keySet() );
			throw new QueryException( "Not all named parameters have been set: " + missingParams, getQueryString() );
		}

		int positionalValueSpan = 0;
		for ( int i = 0; i < values.size(); i++ ) {
			Object object = types.get( i );
			if( values.get( i ) == UNSET_PARAMETER || object == UNSET_TYPE ) {
				if ( reserveFirstParameter && i==0 ) {
					continue;
				}
				else {
					throw new QueryException( "Unset positional parameter at position: " + i, getQueryString() );
				}
			}
			positionalValueSpan += ( (Type) object ).getColumnSpan( session.getFactory() );
		}

		if ( parameterMetadata.getOrdinalParameterCount() != positionalValueSpan ) {
			if ( reserveFirstParameter && parameterMetadata.getOrdinalParameterCount() - 1 != positionalValueSpan ) {
				throw new QueryException(
				 		"Expected positional parameter count: " +
				 		(parameterMetadata.getOrdinalParameterCount()-1) +
				 		", actual parameters: " +
				 		values,
				 		getQueryString()
				 	);
			}
			else if ( !reserveFirstParameter ) {
				throw new QueryException(
				 		"Expected positional parameter count: " +
				 		parameterMetadata.getOrdinalParameterCount() +
				 		", actual parameters: " +
				 		values,
				 		getQueryString()
				 	);
			}
		}