private static void setValueWithNumberedLabel(org.hibernate.query.Query<?> query, Integer key, Object val) {
        if (val instanceof Collection<?>) {
            query.setParameterList(key, (Collection<?>) val);
        } else if (val instanceof Object[] && !BUILT_IN.contains(val.getClass())) {
            query.setParameterList(key, (Object[]) val);
        } else if (val instanceof Number && TYPES.containsKey(val.getClass())) {
            query.setParameter(key, val, getType(val.getClass()));
        } else {
            query.setParameter(key, val);
        }
    }
{@code HibernateUtil} provides static utility methods for Hibernate

@author tiwe
querydsl-jpa/src/main/java/com/querydsl/jpa/hibernate/HibernateUtil.java