@Override
    public T newInstance(Object... a) {
        try {
            T rv = create(getType());
            if (fieldAccess) {
                for (int i = 0; i < a.length; i++) {
                    Object value = a[i];
                    if (value != null) {
                        Field field = fields.get(i);
                        if (field != null) {
                            field.set(rv, value);
                        }
                    }
                }
            } else {
                for (int i = 0; i < a.length; i++) {
                    Object value = a[i];
                    if (value != null) {
                        Method setter = setters.get(i);
                        if (setter != null) {
                            setter.invoke(rv, value);
                        }
                    }
                }
            }
            return rv;
        } catch (InstantiationException | InvocationTargetException | IllegalAccessException e) {
            throw new ExpressionException(e.getMessage(), e);
        }
    }
Create a new QBean instance

@param type type of bean
@param fieldAccess true, for field access and false, for property access
@param bindings bindings
querydsl-core/src/main/java/com/querydsl/core/types/QBean.java