@SuppressWarnings("unchecked")
    @Override
    public void setValue(PreparedStatement st, int startIndex, T value) throws SQLException {
        if (convertPrimitives) {
            // primitives in
            int length = java.lang.reflect.Array.getLength(value);
            Object value2 = java.lang.reflect.Array.newInstance(PrimitiveUtils.wrap(type.getComponentType()), length);
            copy(value, value2, length);
            value = (T) value2;
        }
        Array arr = st.getConnection().createArrayOf(typeName, (Object[]) value);
        st.setArray(startIndex, arr);
    }
{@code ArrayType} maps Java arrays to JDBC arrays

@param <T>
querydsl-sql/src/main/java/com/querydsl/sql/types/ArrayType.java