in NamedQueryCollectionInitializer there are following lines...
Code:
//TODO: is there a more elegant way than downcasting?
AbstractQueryImpl query = (AbstractQueryImpl) session.getNamedQuery(queryName);
if ( query.getNamedParameters().length>0 ) {
query.setParameter(
query.getNamedParameters()[0],
key,
persister.getKeyType()
);
}
query.getNamedParameters() is derived from a hashmap
Code:
return (String[]) actualNamedParameters.toArray(new String[actualNamedParameters.size()]);
in org.hibernate.impl.AbstractQueryImpl
so positionally it cannot be used in this way since order is not guaranteed... I ran into problem here.